javascript - jquery 1.9.1 on event not working -
with jquery v1.5.2 following function works, have upgraded jquery 1.9.1 live has been replaced on function. if change live on. not working.
i changed on live , included migration plugin working. how can use on function
$( ".pop-up" ).live( "click", function( event ){ // id of item clicked on var id = $(this).attr('id'); alert(id) // block href working return( false ); });
try this
instead of document use selector exists in dom, if element added dynamically dom @ later time.
$(function(){ $(document).on("click", ".pop-up", function( event ){ // id of item clicked on var id = $(this).attr('id'); alert(id) // block href working return( false ); }); });
Comments
Post a Comment