Site icon Anthony Carbon

jQuery click event is not working when using .clone() or ajax.

jQuery click event is not working when using .clone() or ajax. You can’t fire a click event after your element is loaded? I found the solutions below.


jQuery( document ).ready(function($) {
$(document).delegate(“#my-clone-id”, ‘click’, function() {
$(this).clone().appendTo( “body” );
});
});

Exit mobile version