1//using plane javascript
2if(document.getElementById('on_or_off_checkbox').checked) {
3 //I am checked
4}
5
6//using jQuery
7if($('#on_or_off_checkbox').is(':checked')){
8 //I am checked
9}
1if (!$("#checkboxID").is(":checked")) {
2 // do something if the checkbox is NOT checked
3}
1$('#isAgeSelected').click(function() {
2 $("#txtAge").toggle(this.checked);
3});
4<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js">
5 </script>
6<input type="checkbox" id="isAgeSelected"/>
7<div id="txtAge" style="display:none">Age is something</div>