title: How to use this in JavaScript?
body: <p>In jQuery we use:</p>
  
  <pre><code>$("p").click(function(){$(this).hide();});
  </code></pre>
  
  <p>In the above statement <code>this</code> is very important, because it hides only that <code>p</code> element on which we click. But instead if we use <code>"p"</code> at the place of <code>this</code> it will hide all the <code>p</code> elements when we click any one of the <code>p</code> element.</p>
  
  <p>I was wondering if there is any way to generate same effect using JavaScript. I tried:</p>
  
  <pre><code>document.getElementsByTagName("p").onclick = function(){this.style.display:none;}
  </code></pre>
  
  <p>and</p>
  
  <pre><code>document.getElementsByTagName("p").onclick = function(){document.getElementsByTagName(this).style.display:none;}
  </code></pre>
  
  <p>But none of this works.</p>