title: Calling JavaScript function ping() in onClick of an HTML hyperlink tag results in TypeError
body: <p>I stumbled upon this today and since I'm no browser guru or a web developer, it's possible I missed something rather obvious. Observe the simple HTML below:</p>
  
  <pre><code>&lt;html&gt;
    &lt;head&gt;
      &lt;script&gt;
          function ping() {
              console.log('pong');
          }
      &lt;/script&gt;
    &lt;/head&gt;
    &lt;body&gt;
      &lt;a href="#" onClick="ping()"&gt;Call ping&lt;/a&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>What I expected when clicking on the link is to have pong printed in the console. However, what I get in both Chrome and Firefox is "TypeError: ping is not a function". If I call the function directly from the console, it works. If I rename the ping function to anything else, it works. If I replace the "a" tag with, say, "button" tag, whilst leaving the function called ping, it works! </p>
  
  <p>It seems that somehow, only in this specific combination: onClick of tag "a" with function called ping() results in the above error. Am I crazy or did I just discover the most insignificant bug in the world? If it is a bug, I find it very strange that it happens in both Chrome and Firefox, since they have different JavaScript engine implementation, different layout engine implementation etc.</p>