jQuery on load of dynamic element
You can trigger a custom event on the newly added DOM element that can be picked-up by a jQuery event handler: //bind to our custom event for the `.sub-element` elements $(‘#container’).on(‘custom-update’, ‘.sub-element’, function(){ $(this).html(‘<b>yaay!</b>’); }); //append a new element to the container, //then select it, based on the knowledge that it is the last child … Read more