Event JavaScript Tutorial

< html>
    
        Mouse Events Example
        
            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;
            }
        
    
    
        

Use your mouse to click and double click the red square.


                     onmouseout="handleEvent(event)"
             onclick="handleEvent(event)"
             id="div1">