I want to create an eventHandler that passes the "this" object as a parameter. I tried this
<select id="customer" onchange="custChange(this);">
It works fine and gets a dom object, through which it is even called for a change.
But according to my understanding, this should not work, since the first argument is expected to be an βeventβ (and not a βthisβ object) in the event handler method, as shown below
<select id="customer" onchange="custChange(event);">
can we pass any argument (this or event) in the eventHandler method so that their name is correct or is the first argument always considered an event object?
javascript onchange
emilly
source share