Answers for "check if not checked vanila js"

0

check if not checked vanila js

<input type="checkbox" id="check">
<a href="#" onclick="check()">click</a>
<button onclick="check()">button</button>
<script>
 function check() {
    		if (document.getElementById('check').checked) {
            alert("checked");
        } else {
            alert("Not checked.");
        }
       
    }

</script>
Posted by: Guest on November-30-2020
0

how to check if input is checked javascript

const cb = document.getElementById('accept');
console.log(cb.checked);
Posted by: Guest on July-17-2020

Code answers related to "check if not checked vanila js"

Code answers related to "Javascript"

Browse Popular Code Answers by Language