Button.click() : Button : Form JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » Form » Button »

 

Button.click()









Syntax








document.form.button.click()



The click() method simulates the click event.












<html>

    <script language="JavaScript">
    <!--
    function clickFirstButton()
    {
      document.myForm.button1.click();
    }
    -->
    </script>
    <form name="myForm">
      <input type="button"
             value="Display alert box"
             name="button1"
             onClick="alert('You clicked the first button.')"><br>
      <input type="button"
             value="Call on button 1"
             name="button2"
             onClick="clickFirstButton()">
    </form>    
    </html>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo Form
» Button