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.
I have written a small html file as well as javascript below it goes,
<html>
<head>
<script>
var prc = {
cng : function(evt){
console.log(evt);
}
}
</script>
</head>
<body>
<input type='text' id='prc' onkeydown="prc.cng(window.event)"/>
<body>
</html>
I tried executing this in Firefox and Chrome, not in IE Still,
When I am trying in Firefox, it gives this error "TypeError: prc.cng is not a function"
, and when trying in chrome it gives the "Uncaught TypeError: Object #<HTMLInputElement> has no method 'cng'"
.
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.
Any Help would be appreciated to enhance my understanding of the issue.