jQuery: Can't select just appended element
Use .find()
http://api.jquery.com/find
var page = $('div#pages').find('div.page#test');
You just need to use live method:
$('.element').live('click', function(){
alert($(this).html());
});
Had the same issue, found that if I added the listener before adding the div, it wouldn't find the div. Make sure to add the listener after making the object.