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;

2008-08-19, 4790👍, 0💬