[jQuery] Event listeners on jQuery generated content
Often times I will insert HTML into an element using jQuery and then
search the dom for these elements and add event listeners. Depending
on how dynamic the data is, I sometimes opt to use livequery.
Using traditional javascript I can use var p =
document.createElement('p'); and then assign an event listener to p
_before_ inserting it into the DOM. I feel like a simple function
would allow me to do both and was wondering if anyone already does
this in jQuery or not. If you do, any sample code and/or plugins im
not aware of are much appreciated