In jQuery you could use .live(), .on(), and .delegate() to bind events to DOM elements that have not been added yet on the page.
Is it possible to use a similar technique to select DOM elements not yet added to apply some functionality?
For instance, I want to select all input elements that have class .req and include a watermark called “Required”.
Im already using a jquery plugin to do the watermark, but can’t work on DOM elements added dynamically to the page.
You can use mutation events(
DOMNodeInserted), but they are deprecated.So unless you want to use them or pull the DOM every X time, the answer is NO
Pulling way: