I'm trying to understand how to get the HTML contents including the parent selector. I know that the following will get me the HTML contents:
$obj.html();
(where $obj is a reference to my DOM object)
But what if I want the HTML contents including the parent selector? For example, let's say I have this code:
<div id="sample" class="something">
<div class="inner"></div>
</div>
If I do:
$('#sample').html();
...I will get:
<div class="inner"></div>
But what I really want retuned is this:
<div id="sample" class="something">
<div class="inner"></div>
</div>
Any ideas?