Answers for "jQuery onclick not firing on dynamically inserted HTML elements"

0

jQuery onclick not firing on dynamically inserted HTML elements

$(document).on( 'click', '.classname', function () { 
alert('clicked');
});

**** Another Method ****
// where #wrapper is a static element in which you add the dynamic links.
$( '#wrapper' ).on( 'click', 'a', function () { alert('clicked'); });
Posted by: Guest on September-04-2021

Code answers related to "jQuery onclick not firing on dynamically inserted HTML elements"

Code answers related to "Javascript"

Browse Popular Code Answers by Language