title: jQuery : Getting the parent content
body: <p>I have the following DOM structure : </p>
  
  <pre><code>&lt;html&gt;
      &lt;head&gt;
          &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js" type="text/javascript"&gt;&lt;/script&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;div id="main"&gt;
              &lt;div id="column-1"&gt;
                  This is the column one text
              &lt;/div&gt;
              &lt;div id="column-2"&gt;
                  &lt;div id="part-1"&gt;
                      Part one
                  &lt;/div&gt;
                  &lt;div id="part-2"&gt;
                      Part two
                      &lt;script type="text/javascript"&gt;
                          alert($(this).parent().html());
                      &lt;/script&gt;
                  &lt;/div&gt;
                  &lt;div id="part-3"&gt;
                      Part three
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;  
  
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>What I want is to get the content of the parent (<code>&lt;div id="part-2"&gt;</code>).</p>
  
  <p>The problem is a the instruction : <code>alert($(this).parent().html())</code>.</p>
  
  <p>Why it is returning null ?</p>
  
  <p>(PS: I know I can reach the <code>&lt;div id="part-2"&gt;</code> with <code>$("#part-2").html()</code>, but the parent id can change dynamically this is why I want to get that parent with the <code>$(this).parent().html()</code> instruction)</p>