Jeff Prachyl Jeff Prachyl - 1 year ago 102
Javascript Question

Call javascript function only when checkbox is NOT checked

I'm trying to figure out how to call a javascript function only when a checkbox is NOT checked.

here is my checkbox:

<input type="checkbox" id="icd" name="icd" value="icd" />

here is the name of the function:



Answer Source
document.getElementById('icd').onchange = function() {
    if ( document.getElementById('icd').checked === false ) {
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download