10 examples of 'javascript set checkbox checked' in JavaScript

Every line of 'javascript set checkbox checked' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
74function set_radio_checked(id) {
75 $('#' + id).prop('checked', true);
76}
78function set_checkbox_value(id, value) {
79 $('#' + id).prop('checked', value);
80}
5function checkboxChanged(checkboxInput) {
6 var $rgbaInput = $(checkboxInput).siblings('input.cascade-rgba');
7 var $colorInput = $(checkboxInput).siblings('input[type="color"]');
8 if (checkboxInput.checked || checkboxInput.disabled) {
9 $rgbaInput.addClass('disabled');
10 $colorInput.addClass('disabled');
11 } else {
12 $rgbaInput.removeClass('disabled');
13 $colorInput.removeClass('disabled');
14 }
15}
194private _setChecked(isChecked: boolean) {
195 console.debug('_setChecked')
196 if (isChecked !== this._checked) {
197 this._checked = isChecked;
198 if (this._init) {
199 this.change.emit(this);
200 }
201 this._item && this._item.setCssClass('item-toggle-checked', isChecked);
202 }
203}
42function checkRadioButton() {
43 document.getElementById('control2').setChecked(true);
44}
3function check_checkbox (checkbox) {
4 if (checkbox.prop('checked')) {
5 checkbox.parents('label.checkbox').addClass('checkbox_state_cheked');
6 } else {
7 checkbox.parents('label.checkbox').removeClass('checkbox_state_cheked');
8 }
9}
218set checked(checked: boolean) {
219 if (this._type !== 'check' || checked === this._checked) {
220 return;
221 }
222 this._checked = checked;
223 this.changed.emit(void 0);
224 this.toggled.emit(checked);
225}
31function checkboxClicked() {
32 //compute the new flag value
33 var newFlagValue = 0;
34 for(var i = 0; i < lstFlags.length; i++) {
35 var checkBox = document.getElementById('cb' + i);
36 if(checkBox.checked) {
37 newFlagValue |= lstFlags[i][1];
38 }
39 }
40 var textbox = document.getElementById('tb');
41 textbox.value = newFlagValue;
42 explainFlags();
43}
12function uncheckCheckBox(checkbox){
13 $(checkbox).removeAttr("checked");
14}
110function isChecked(id,name){
111 var elem = goog.dom.getElement(id);
112 return elem.checked;
113};

Related snippets