javascript - jQuery: Can't select just appended element -


this happens on event:

$('div#pages').append($('<div class="page" id="test">...</div>')); 

and then, on event fails doing this:

var page = $('div.page#test'); // returns empty array 

i've debugged, , appended html appears in document structure after appending, fails selected. doing same in browser console works perfectly.
problem?

use .find() http://api.jquery.com/find

var page = $('div#pages').find('div.page#test'); 

Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -