We would like to know how to set focus to checkbox.
<!-- ww w . j a va 2s . c o m-->
<html>
<form name="myForm">
<input type="checkbox" name="checkBox1">Option 1<br>
<input type="checkbox" name="checkBox2">Option 2<hr>
<input type="button" name="focusButton" value="Move Focus" onClick="moveFocus()">
</form>
<script language="JavaScript">
function moveFocus() {
document.myForm.checkBox1.focus();
}
</script>
</html>
The code above is rendered as follows: