Reattach event to an element

Reattach event to an element

I'm trying to develop a search box overlabel feature working off of the example provided in Learning jQuery. I have everything working great except for one problem, it breaks when I switch out the content using ajax.

I'm using CGI::Ajax for my ajax functionality and I have my page laid out as follows

<ajax return div>


<results table>
<search box>
<pagination controls>
</div>

When a user pages, the ajax fires, the entire div is swapped out and the results table updates. Obviously when do that, my the overlable function isn't firing to manipulate the label and the overlabel shows up in the search box along with whatever the current search string is. Is there some way I can tell jquery to re-run the overlay control function when that search box form (or even the whole div) is re-loaded?

I've tried using the live function and binding the form/div to load and ready events, but neither of those is working, from what I can tell there aren't any events that can be attached to a div that will do what I need.

The layout of the page dictates that the search and pagination controls be on the same horizontal plane, and I'd prefer not to change that, so I'd like to try to get around the simple solution of just moving the search box outside of that div.

If this doesn't make sense, let me know and I'll post some example code.