I can't quite get understand of this simple example:
<button onclick='clickHandler(this)'>test</button>
function clickHandler(el){
var a = this;
}
When clicking the button, el
is mapped to HTML
event listener. But, a=this
called inside function gives me global window object.
Why is this
inside function body not a HTML event listener (in this case it's button).