jQuery Button click not firing issue -
i trying implement previous button on test app. cant button id="prev" fire. keeping simple this:
//begin previous button click function // $("#btn2").click(function() { alert("i'm in previous button click"); }); // end of previous click function here jsfiddle nothing in console , setting break point in function not called when stepping thru program. checked dom make sure btn2 there , is. suggestion appreciated.
the element doesn't exist when document ready, because inserted after dom.
try instance:
$(document).on("domnodeinserted", function() { // call prev button function or insert code here });
Comments
Post a Comment