Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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;
}
 
PREVIOUS NEXT
Tagged: #javascript #set #checkbox #checked #based
ADD COMMENT
Topic
Name
2+6 =