JQuery clone the within a div id to another div?

It's hard to provide the best solution without seeing your HTML, but you should be able to just find the ul: $("#keyfeatures"). Find("ul").clone(). PrependTo("#keyfeaturestop"); However, this may not work as expected if there are multiple ul elements within #keyfeatures.

You'll need to provide more information (such as which one you need to clone) if that's the case. To select the first ul you have several options (in fact, more than just these 3! ): $("#keyfeatures ul:first").clone().

PrependTo("#keyfeaturestop"); $("#keyfeatures ul"). Eq(0).clone(). PrependTo("#keyfeaturestop"); $("#keyfeatures ul").first().clone().

PrependTo("#keyfeaturestop"); Also, you said in your question: I'm using the following jquery to clone the contents of a div Note that you're not cloning the contents of the div, but rather the div itself. In your example #keyfeaturestop will contain a child div which is a clone of #keyfeatures.

Thanks I realized there may be multiple ul's in the div which could cause a problem, for now there is only one. But using the .find() function is there a method to select the first instance of a ul found? – Anagio Nov 6 at 10:32 Yeah, see my edit – James Allardice Nov 6 at 10:41.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions