Mouse event related element (Firefox) : Mouse Event : Event JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » Event » Mouse Event »

 

Mouse event related element (Firefox)

















<html>
    <head>
        <title>Mouse Events Example</title>
        <script type="text/javascript">
            function handleEvent(oEvent) {
                var oTextbox = document.getElementById("txt1");
                oTextbox.value += "n>" + oEvent.type;
                oTextbox.value += "n    target is " + oEvent.target.tagName;
                oTextbox.value += "n    relatedTarget is " + oEvent.relatedTarget.tagName;


            }
        </script>
    </head>
    <body>
        <P>Use your mouse to click and double click the red square.</p>
        <div style="width: 100px; height: 100px; background-color: red"
             onmouseout="handleEvent(event)"
             onclick="handleEvent(event)"
             id="div1"></div>
        <P><textarea id="txt1" rows="15" cols="50"></textarea></p>
    </body>
</html>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo Event
» Mouse Event