title: Jquery: Get Head and Body Tag Contents from string
body: <p>I am having a string like below:</p>
  
  <pre><code>&lt;head&gt;
      This is the Head
  &lt;/head&gt;
  &lt;body&gt;
      &lt;div&gt;
          &lt;div&gt;
              &lt;p&gt; Body Content &lt;br /&gt;&lt;/p&gt;
              &lt;p&gt;&amp;nbsp; Hello World &lt;br /&gt;&lt;/p&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>It is having both head and body tags. Now I want the contents of head tag and body tag using jquery. Can anyone help?</p>