Answers for "how to set checkbox value in javascript"

11

javascript check uncheck checkbox

document.getElementById("myCheckBoxID").checked = true; // Check
document.getElementById("myCheckBoxID").checked = false;// Uncheck
Posted by: Guest on August-02-2019
-1

javascript set checkbox checked based on value

//HTML
<input type="checkbox" id="Numbers">Short Numbers</input>
<button type="button" onClick="changeCheckbox()">Save</button>
//JAVASCRIPT
function changeCheckbox(){
  	if(value)
	document.getElementById("Numbers").checked = true;
}
Posted by: Guest on August-05-2021

Code answers related to "how to set checkbox value in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language