How to select html content including the selector element
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/2419749/get-selected-elements-outer-html">Get selected element&#39;s outer HTML</a>  </p>
</blockquote>



<p>Please get me out of this doubt.<br>
My HTML code is  </p>

<pre><code>&lt;div id="ToBe"&gt;&lt;div class="text"&gt;Hello&lt;/div&gt;&lt;/div&gt;
</code></pre>

<p>My jQuery code is </p>

<pre><code>var x=$('#ToBe').html();
alert(x);
</code></pre>

<p>But it is displaying </p>

<pre><code>&lt;div class="text"&gt;Hello&lt;/div&gt;
</code></pre>

<p>But my requirement is to display</p>

<pre><code>"&lt;div id="ToBe"&gt;&lt;div class="text"&gt;Hello&lt;/div&gt;&lt;/div&gt;" 
</code></pre>

<p>as output.<br>
How can i get that.</p>
