title: Store contents of a tag in Javascript variable
body: <p>I am learning Javascript and I  am trying to learn some pretty basic stuff. Basically I have some text in a <code>&lt;p&gt;</code> tag which I want to append to a variable. However it is not working an I'm not sure why. Any help will be greatly appreciated. </p>
  
  <pre><code>&lt;html&gt;
  
  &lt;head&gt;
  &lt;script type="text/javascript" src="js/jquery.js"&gt; &lt;/script&gt;
  &lt;script type="text/javascript"&gt;
    var x = $('p').html();
    document.write(x);
  &lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
    &lt;p class="first"&gt;Hello World  &lt;/p&gt;
  &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>