I have a page that appends and removes inputs from DOM using jquery. Some of them share a class ("numeric"). Once each input is appended, my code should call .numeric() to every new input with "numeric" class. I defined this block at the beginning of the code,
$('input.numeric')
.live('load', function() {
$(this).numeric();
});
but load seems not to be related to appended nodes after DOM is loaded. Ready event isn't working either.
How could I do that? Thanks mates
Edit: I managed to solve this following @BGerrissen methods in a more general way. I already defined a wrapper for appending (which I called draw), and then each time I append anything, I trigger $(document).trigger('appended'), so it is easy to track anywhere. Then I use
$(document)
.bind('appended', function() {
$('input.numeric').numeric();
});
To do what I need. Cheers