Getting the contents inside an html tag
<p>I have some simple code below:</p>

<pre><code>&lt;script&gt;
$(function() {
  $("h1").click(function(){
    console.log((this));
    $("p").toggle();
  });
});
&lt;/script&gt;
&lt;/head&gt;

&lt;body&gt;
&lt;h1&gt;test&lt;/h1&gt;
&lt;p&gt;If you click test, I will toggle.&lt;/p&gt;

&lt;/body&gt;
</code></pre>

<p>If I click on test I can toggle the visibility of the p tag. At the same time I am writing <code>&lt;h1&gt;test&lt;/h1&gt;</code> to the console. What I want is to write the word test only to the console. How do I do that? Nothing I tried works.</p>

<p>Thanks,
Jim</p>
