Snippet. JavaScript. How to Find, if a Chekbox is Checked or NotThis little JavaScript snippet shows how to find, if a checkbox is checked or not. <input type="checkbox" onclick="if(this.checked==true) { on_checked(); } else { on_not_checked(); }"> ExampleThis example shows a download button, if the user accepts the terms and conditions. <input type="checkbox" onclick="if(this.checked==true) { document.getElementById('button_download').style.display = 'block'; } else { document.getElementById('button_download').style.display = 'none'; }"> Do you agree with the Terms and Conditions? TestDo you agree with the Terms and Conditions?Updated on: 23 Nov 2024 |
|