I know this is bad practice. Don\'t write code like this if at all possible.
Of course, we\'ll always find ourselves in situations where a clever snippet of inline
What the browser does when you've got
is to set the actual value of "onclick" to something effectively like:
new Function("event", "alert('Hi');");
That is, it creates a function that expects an "event" parameter. (Well, IE doesn't; it's more like a plain simple anonymous function.)