Where is "evt" defined in an HTML event handler

Viewed 40

I ran across some code like this:

<svg xmlns="http://www.w3.org/2000/svg"
 viewBox="0 0 30 20"
 onload="console.log('hello', evt, this)">

Can someone tell we where evt is defined and/or documented?

When I run it I see that evt is defined to be the event object associated with the onload event. And this points the SVG element. Chrome's debugger tells me that evt and this are both local variables.

I tried https://www.google.com/search?q=html+event+handler+evt and several variations on that theme. All I've learned from there is that evt, e, and event are commonly used as the name of a parameter inside of an event handler function. But this evt is created by Chrome, and if I change my sample code to say e I will get an undefined variable and a reference error in the console.

Thanks!

edit

I've been poking around a little more. The Chrome debugger shows me this. Chrome added onLoad(evt) { and } all on its own. It wrapped that function around the code I gave it. Interesting.

enter image description here

0 Answers
Related