$('.selector').closest('div') for non click element
<p><strong>First Case</strong>:</p>

<pre><code>&lt;div&gt;
  &lt;a href="#" onclick="doIt(this)"&gt;some job&lt;/a&gt;
&lt;div&gt;
</code></pre>

<p>i can do:</p>

<pre><code>&lt;script&gt;
  function doIt(caller){
       alert($(caller).closest('div').html());
  }
&lt;/script&gt;
</code></pre>

<p><strong>Second Case:</strong></p>

<pre><code>&lt;div id="divId"&gt;
  ....
&lt;/div&gt;
</code></pre>

<p>i do </p>

<pre><code>&lt;script&gt;
  alert($("#divId").html());
&lt;/script&gt;
</code></pre>

<p>how can i apply first case mecanism to second case with out onclick(this)?</p>

<p>more details about question:</p>

<p>First case, as i use of anchor onclick, i can get action source then it's parent.</p>

<p>Second case, on the other hand, there is div block and after script block. they are rendered in the page, consequence there is no click event.
i need some thing:</p>


 
    $(this).closest('div').html()   
 


<p>but it doesnt work</p>
