I am a beginner to Javascript. And when I was practicing I have noticed something.
Take this function:
Well, the code:
onkeypress="return showChar('some text', oEvent);"
Is the equivalent of the following JavaScript code:
element.onkeypress = function (eventObjectName) {
return showChar('some text', eventObjectName);
};
It's just that browsers name the event argument as event.
So, the value of the attribute is wrapped in a JS function which receives an argument named event which is the event object.