title: getElementsByTagName in JavaScript
body: <p>I'm new to the syntax of pure JavaScript; Do you know why "getElementsByTagName" is not working in my simple test:</p>
  
  <pre><code> var btn = document.getElementsByTagName('button');
  console.log(btn);
  
  
  btn.onclick=function(){
      alert('entered');
  document.getElementById("demo").innerHTML="test";
  }
  </code></pre>
  
  <p><a href="http://jsfiddle.net/web_developer_888/ZH8XA/" rel="nofollow">Fiddle</a></p>