javascript check uncheck checkbox
document.getElementById("myCheckBoxID").checked = true; // Check
document.getElementById("myCheckBoxID").checked = false;// Uncheck
javascript check uncheck checkbox
document.getElementById("myCheckBoxID").checked = true; // Check
document.getElementById("myCheckBoxID").checked = false;// Uncheck
javascript checkbox onchange
<!-- Find values of checked boxes with jquery -->
<div class="fruit">
<label>
<span>Apple</span>
<input onchange="checkValues()" name="apple" type="checkbox" value="apple">
</label>
<label>
<span>Banana</span>
<input onchange="checkValues()" name="banana" type="checkbox" value="banana">
</label>
<label>
<span>Grape</span>
<input onchange="checkValues()" name="grape" type="checkbox" value="grape">
</label>
</div>
<script>
function checkValues() {
$('.fruit input:checkbox').each(function(index, element) {
if (element.checked === true) {
console.log(element.value)
}
});
}
</script>
oncheck checkbox javascript
<input type='checkbox' onchange='handleChange(this);'> Checkbox
function handleChange(checkbox) {
if(checkbox.checked == true){
document.getElementById("submit").removeAttribute("disabled");
}else{
document.getElementById("submit").setAttribute("disabled", "disabled");
}
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us