I’m trying to hide some divs that I have created dynamically using the .hide() function but no luck. I think the reason it’s not working is because elements that have not yet been added to the DOM. Is there a way around it?
$('<div class="toggle_container"></div>').html('<div
class="block"><p>'+title+'</p></div>').appendTo('#page-wrap'); //dynamic creation of divs
$(".toggle_container").hide(); //trying to hide,but not working
Thanks
It works fine http://jsfiddle.net/TMtCz/ You could however hide it before you append it, like so: