Checkbox.click() : CheckBox : Form JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » Form » CheckBox »

 

Checkbox.click()










Syntax








document.form.checkbox.click()



The click() method simulates the click event.

The clicked property is adjusted accordingly when this method is used.












<html>
    <form name="orderForm">
      <input type="checkbox" name="door4" onClick="alert('door4')">doors<br>
      <input type="checkbox" name="door2" onClick="displayNote()">doors<hr>
      Step 2:
      <input type="button" value="Submit Order" name="orderButton" onClick="alert('submitted')">
    </form>
    <script language="JavaScript">
    <!--
    function displayNote(){
      alert("Have you considered the 4-door version?");
      document.orderForm.door4.click();
    }
    -->
    </script>
    </html>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo Form
» CheckBox