Click to See Complete Forum and Search --> : how to get inside a function an event called this function?


bounzer
08-11-2003, 09:27 AM
How to get inside a function an event called this function? For example, there is a myfunc () and i'm calling it for onMouseOver event. How to detect that myfunc () was called from onMouseOver event?

requestcode
08-11-2003, 09:45 AM
Something like this:
<html>
<head>
<title>OnMouseOver Test</title>
</head>
<body>
<script language="JavaScript">
function event_status(obj,e)
{
alert(e.type+"\n"+obj.id)
}
</script>
<br><br><br>
<a href="#" id="link1" onmouseover="event_status(this,event)">First Link</a><br><br>
<a href="#" id="link2" onClick="event_status(this,event)">First Link</a>
</body>
</html>

bounzer
08-11-2003, 10:37 AM
so i have to write my own event handler, there is no built-in? :(

anyway, thanks for the nice solution!