Call 'click()' to triger event : CheckBox « Form Control « JavaScript DHTML
- JavaScript DHTML
- Form Control
- CheckBox
Call 'click()' to triger event
<html>
<body>
<script language="JavaScript">
function function1() {
myCheckbox.focus();
myCheckbox.click();
}
</script>
<input type="checkbox" id="myCheckbox" value="checkbox">
<button onclick="function1();">Click the checkbox</button>
</body>
</html>
Related examples in the same category