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')">4 doors<br>
<input type="checkbox" name="door2" onClick="displayNote()">2 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>