jQuery: $("#myid").html('<span id="inserted">inserted portion</span>') -


say doing following manipulation using jquery:

$("#myid").html('<span id="inserted">inserted portion</span>') 

after doing operation, if view page source, inserted portion of html (the span tag id "inserted") not available there , further operation $("#inserted") fails!

this becomes major issue when update (we use jquery html() method insert new parts) part of page ajax call , try more operations in updated part.

please explain missing?

whatever events binding id inserted ....use live , bind future html elements or html added @ runtime

http://api.jquery.com/live/  $('#inserted ').live('click', function() {   // live handler called. }); 

Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -