How to determine the state of a checkbox using JavaScript?

Q

How to determine the state of a checkbox using JavaScript?

✍: Guest

A

Use the "checked" property of the checkbox object. For example:
var checkedP = window.document.getElementById("myCheckBox").checked;

2010-10-19, 3717👍, 0💬