I want to able to get #post content include itself. jQuery's html() method only return content that does not include itself.Trying to get parent object's html does not work in all situation because that object can have siblings.
What is solution for this ?
<div id="post">
<div>content</div>
<div>
<div></div>
jQuery's html()
gives you only the innerHTML right. You can do
$("#post")[0].outerHTML
to get the full html but this is not crosser browser compatible.
Check out this jsFiddle Demonstration
.outerHTML()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With