how do i check if JQuery checkbox is checked
$( "SELECTOR" ).attr( "checked" ) // Returns ‘true’ if present on the element, returns undefined if not present
$( "SELECTOR" ).prop( "checked" ) // Returns true if checked, false if unchecked.
$( "SELECTOR" ).is( ":checked" ) // Returns true if checked, false if unchecked.$("checkbox").is(":checked")if ($('#grepperRocks').is(':checked')) {
// this checkbox is checked
}$('#isAgeSelected').click(function() {
$("#txtAge").toggle(this.checked);
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js">
</script>
<input type="checkbox" id="isAgeSelected"/>
<div id="txtAge" style="display:none">Age is something</div>
Also in JavaScript:
- output event angular
- javascript not empty array not string
- primitive and non primitive data types in javascript
- js detect screen size change
- port 3000 is already in use nodemon app crashed
- showing an image in react js
- split string into char array javascript
- updatable time js
- dm discord.js
- javascript conver time into 24 hour format
- anonymous functions javascript
- how to add array data on state react
- js remove plus
- sum range javascript
- how to cause a whole page reload react redux
- convert javascript date into excel date
- largest and smallest number in an array 1-100 javascript
- javascript push item to beginning of array
- using aria attributes in angular
- detecting change in animated value react native
- Accessing Nested Arrays
- access css property using javascript
- jquery check if all elements hidden
- javascript create script tag