I have a div with many childen. How do I move all of them to another div using jQuery?
my code looks like:
jQuery("body").append("<div id='popupWrapper'></div>");
var myID = $('.FloatingFrameLightBlue1').attr('id');
jQuery(myID).children().append("popupWrapper");
But it doesn't work. What I'm doing wrong?
Here you have a very simple example of it: http://jsfiddle.net/LhR79/
As they have already told you. You need to use appendTo instead of append and specify the selector type (class, id... ) using the . or the # preceding the name. In your case: #popupWrapper as popupWrapper is an ID and not a class.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With