Click to See Complete Forum and Search --> : event type


crs
05-21-2003, 10:01 AM
This code works on IE and Opera but not in Mozilla... abd I would like it to work in all of them.

What can I do?

<html>
<head>
<title>Title</title>

<script>
<!--
function myFunction (myObject)
{
myObject.nextSibling.innerText = window.event.type;
}
-->
</script>
</head>

<body>
<div onClick="myFunction(this)" onMouseOver="myFunction(this)" onMouseOut="myFunction(this)">Do me...</div><div>...</div>
</body>
</html>

Thank you in advance

requestcode
05-21-2003, 10:12 AM
Try this:

<html>
<head>
<title>OnMouseOver Test</title>
</head>
<body>
<script language="JavaScript">
function winstatus(elm)
{
alert(elm.type)
}
</script>
<br><br><br>
<a href="myform.html" id="link1" onMouseOver="winstatus(event)">First Link</a>
</body>
</html>

crs
05-21-2003, 10:24 AM
I am happy again :)... thank you.

Now this works:

<html>
<head>
<title>OnMouseOver Test</title>
</head>
<body>
<script language="JavaScript">
function myFunction (myType, myObject)
{
myObject.nextSibling.innerHTML = myType.type;
}
</script>
<br><br><br>
<a onClick="myFunction(event,this)" onMouseOver="myFunction(event,this)" onMouseOut="myFunction(event,this)">Do me</a><div>...</div>
</body>
</html>