Advertisement
728x90
You can apply the checked property on the selected checkbox in the DOM. If the value is true it means the checkbox is checked, otherwise it is unchecked. For example, the below HTML checkbox element can be access using javascript as below:
html
1<input type="checkbox" id="checkboxname" value="Agree" />
2
3Agree the conditions
4<br />javascript
1console.log(document.getElementById(‘checkboxname’).checked); // true or falseAdvertisement
Responsive Ad
🎯 Practice NowRelated Challenge
JavaScript Coding Exercise 77
Test your knowledge with this interactive coding challenge.
Start CodingAdvertisement
728x90
334of476