Getting the outer div in JQuery [duplicate]
Possible Duplicate:
Get selected element's outer HTML
I'm getting a class like this:
<div class="clas开发者_运维知识库sName">
content in here
</div>
And then I'm getting it in JQuery like this:
$('.className').html()
Which only outputs:
content in here
When I want it to get everything, including the parent div.
Thanks for any help
$('.className').clone().wrap('<div></div>').parent().html();
http://jsfiddle.net/ipr101/WX69N/
精彩评论