开发者

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()
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜