I have a page element for which onMouseOver and onMouseOut call the same function. However, I want the function to do something different depending on which of these two events initiated it. Does Javascript include some sort of functionality to detect which event has triggered something?
I know that I can just make two versions of the function, or pass some sort of argument to differentiate between events, but I'm looking for something more elegant.
Thanks.