How can I get the ID of an element that called a JS function?
body.jpg is an image of a dog as the user points his/her mouse around the screen at different
For others unexpectedly getting the Window element, a common pitfall:
<a href="javascript:myfunction(this)">click here</a>
which actually scopes this
to the Window object. Instead:
<a href="javascript:nop()" onclick="myfunction(this)">click here</a>
passes the a
object as expected. (nop() is just any empty function.)