Form.handleEvent() : Form Object : Form JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » Form » Form Object »

 

Form.handleEvent()










Syntax








form.handleEvent(event)



The handleEvent() method invokes the handler for the specified event.

It takes one parameter, which is the event to be handled.












<html>
    <head>
    <title> Using the handleEvent method of the Form object</title>
    </head>
    <body>
    <script language = "JavaScript">
    <!--
    function handleMyClick(evnt){
        window.document.button1.handleEvent(evnt);
    }
    function displayMsg(){
         document.form1.msg.value += "Click event occurred.n";
    }
    document.onclick = handleMyClick;
    -->
    </script>
    <form name="form1">
    <input type="button" value="Click on Me" name="button1" onClick='displayMsg()'>
    <br><br>
    <textarea name="msg" rows="10" cols="50" onClick='displayMsg()'></textarea>
    </form>
    </body>
    </html>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo Form
» Form Object