jquery check checkbox
//using plane javascript
if(document.getElementById('on_or_off_checkbox').checked) {
//I am checked
}
//using jQuery
if($('#on_or_off_checkbox').is(':checked')){
//I am checked
}$('.myCheckbox').prop('checked', true);
$('.myCheckbox').prop('checked', false);// jQuery version 1.6 or above use:
$("#myRadioID").prop("checked", true);
//jQuery versions below 1.6 use:
$("#myRadioID").attr('checked', 'checked');//jQuery 1.6+ use:
$('.checkboxClass').prop('checked', true);
//jQuery 1.5.x and below use:
$('.checkboxClass').attr('checked', true);$(your_checkbox).is(':checked');$("checkbox").is(":checked")
Also in JavaScript:
- setinterval javascript
- after changing the state clearing input feild
- jquery get request
- javascript float to int
- how to define variable in javascript
- react ctx
- get and set es6
- javascript find duplicate in array
- npm stop react app
- js fucntion return array
- ejs comments
- get current directory vbscript
- javascript extract date from string
- download comma separated file, react
- js get date in ms
- Robux gift
- hide warnings in expo app
- javascript if field exists
- launch.json vscode electron
- react checkbox onChange
- javascript give class to element
- most used events in javascript
- redux connect
- javascript floor