Append jQuery values not affected by javascript -
i'm appending values div through jquery, i've realized gets appended isn't affected javascript functions.
$(".div").append("<input type='text' class='textform' placement='value' />");
what have setup in javascript code takes attribute placement of class "textform" , makes value. i've realized once value appended, isn't effected javascript. ideas on how fix issue?
i guess have events bounded elements not working after append . this.
$(function(){ $(".someclass").click(function(){ //dome thing }); });
if want same functionality work on newly injected( dynamically added via append /jquery ajax etc...) dom elements, should consider using jquery on
. code should changed this
$(function(){ $(document).on("click",".someclass",function(){ //dome thing }); });
on
work current , future elements
Comments
Post a Comment