get entire contents of a div
var thisWish = $(#div开发者_高级运维1).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
This should work:
thisWish = $('div#1').html()
try this...
thisWish = $('div#1').html()
精彩评论