TypeError: prc.cng() is not a function in Firefox, Uncaught TypeError: Object #<HTMLInputElement> has no method 'cng' in Chrome
<p>I am writing a small library for internal use in a project that I am working on, I am an amateur Javascript developer, so mind my mistakes please.</p>

<p>I have written a small html file as well as javascript below it goes,</p>

<pre><code>&lt;html&gt;
 &lt;head&gt;
  &lt;script&gt;
    var prc = {
      cng : function(evt){
           console.log(evt);
      }
    }
  &lt;/script&gt;
 &lt;/head&gt;
 &lt;body&gt;
   &lt;input type='text' id='prc' onkeydown="prc.cng(window.event)"/&gt;
 &lt;body&gt;
&lt;/html&gt;
</code></pre>

<p>I tried executing this in Firefox and Chrome, not in IE Still,</p>

<p>When I am trying in Firefox, it gives this error <code>"TypeError: prc.cng is not a function"</code>, and when trying in chrome it gives the <code>"Uncaught TypeError: Object #&lt;HTMLInputElement&gt; has no method 'cng'"</code>.</p>

<p>I tried searching for this in StackOverflow, but the issues they are facing is quite different from what I am facing. Almost most of the issues faced were with jQuery involved, here please note that I am not using any kind of library and writing with plain old Javascript.</p>

<p>Any Help would be appreciated to enhance my understanding of the issue.</p>
