How can I call a function after an element has been created in jquery?
How are you creating the element? If you’re creating it in the static HTML then just use .ready(handler) or .on(“load”, handler). If you’re using AJAX though that’s another kettle of fish. If you’re using jQuery’s load() function then there’s a callback you can run when the contents been loaded: $(‘#element’).load(‘sompage.html’, function(){ /* callback */ }); … Read more