When I load my page initially, I select everything using a certain CSS class, and then attach a tooltip to it as follows ("doTooltip" is the name of the CSS class):
$(document).ready(function () {
$('.doTooltip').tooltip();
});
This works great. However when I load some additional content into the page via AJAX, any new elements with the doTooltip class applied will not have .tooltip() executed against them, since they were loaded after the ready() event.
How can I instruct jQuery to apply .tooltip() to newly loaded elements which use doTooltip?
Or is the only solution to tuck the supplied code into a function, and call this function each time I load new content into the page? I'm hoping there is a better way than this, because I use the supplied code globally.