checkbox default value and checked value get in jquery
.prop('checked', true);
//selected checkbox alert boolen value return
$('#test').click(function() {
alert("Checkbox state (method 1) = " + $('#test').prop('checked'));
alert("Checkbox state (method 2) = " + $('#test').is(':checked'));
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
Check me: <input id="test" type="checkbox" />
//@sujaY
Also in JavaScript:
- angular file upload app with django
- convert timestamp to date js
- nuxtjs http multiple proxy
- how to create my own filter in js
- how to get cwd nodejs
- node js how to basic auth to specific urk
- w3schools json
- how to delay something in javascript
- javascript lookahead
- js loop ul
- d3js circle out of scrren
- jquery ajax upload image
- javascript math absolute
- get top items from json object
- ready function javascript
- change view port of svg with javascript
- promise catch
- javascript return value from async function site:stackoverflow.com
- Check ratelimit discord js
- CocoaPods could not find compatible versions for pod "ReactCommon/jscallinvoker"
- Module Error (from ./node_modules/eslint-loader/dist/cjs.js):
- javascript loop through array backwords
- create react app scaffolding
- javascript console error