Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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>
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #check #checked #vanila #js
ADD COMMENT
Topic
Name
5+2 =