javascript - Bind click events to dynamically created html content -
this question has answer here:
- jquery 1.9 .live() not function 10 answers
i've got following jquery command bind click event when specific element dynamically created.
$(".bill-remove-icon").live("click", function(){ $(this).parent().hide('slide',function(){$(this).parent().remove()}); }); but code gives firebug error :
typeerror: $(...).live not function what doing wrong here? if code wrong, pls suggest better method bind events dynamically created elements.
live deprecated, have use delegation .on():
$(document).on("click", ".bill-remove-icon", function(){ $(this).parent().hide('slide',function(){$(this).parent().remove()}); });
Comments
Post a Comment