I'm trying to add an onclick of a link and, in the handler function, get a reference to the clicked element.
I thought this code should work, and work across browsers:
Code:
<script>
function getit(e)
{
	if (!e) var e = window.event;
	alert(e);
}
</script>
<a href='#' onclick="getit(); return false;">click</a>
Works fine in IE However in firefox e is undefined. What am i doing wrong?

I know it's possible, so I wanted to figure it out rather than resort to passing 'this' along with every function call.