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

Popular posts from this blog

javascript - backbone.js Collection.add() doesn't `construct` (`initialize`) an object -

php - Get uncommon values from two or more arrays -

Adding duplicate array rows in Php -