Reputation: 686
var thisWish = $(#div1).children('p,blockquote,.name').html();
<div id="1">
<p>Hello</p>
<blockquote> my name is </blockquote>
<p class="name">Callum</p>
</div>
How can i put the entire contents of a div into a variable? I dont justwant the html of each variable, i need the elements aswell, so basically i need
thisWish = <p>Hello</p>
<blockquote> my name is </blockquote>
<p class="name">Callum</p>
Thanks
Upvotes: 0
Views: 271