Yesterday I had to go back to a page I had worked on a few weeks ago to redo the UI. The UI consisted of a jQuery UI tab control with 3 tabs. Each tab had 3-5 controls inside of it, and a submit button to only submit the data within the tab. I had to reorganize some of the tabs, remove some textboxes, add some drop down lists, modify some behaviors and even work a bit on the client side validation (which uses jQuery Validation). What I found during this excercise, thought, was that I had to go back and recheck each and every one of my jQuery selectors. Some were left intact, but many of them changed.
I'm wondering what design pattern (if any) do people use to avoid or minimize the effect of refactoring or reworking a webpage that had heavy jQuery usage. I'm sure it can't be just "Search" + "Search And Replace".