10 examples of 'jquery set checkbox checked based on value' in JavaScript

Every line of 'jquery set checkbox checked based on value' 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
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}
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}
74function set_radio_checked(id) {
75 $('#' + id).prop('checked', true);
76}
12function uncheckCheckBox(checkbox){
13 $(checkbox).removeAttr("checked");
14}
19public set checked(value: boolean){
20 if(!value){
21 this.el.removeAttribute("checked");
22 }else{
23 this.el.setAttribute("checked", "checked");
24 }
25}
191function isChecked(checkboxElement) {
192 return checkboxElement.hasClass(CHECKED_CSS);
193}
128_setChecked (values, el) {
129 for (let i = 0, l = values.length; i < l; i++) {
130 let value = values[i]
131 if (!el.disabled && el.value === value && !el.checked) {
132 el.checked = true
133 }
134 }
135}
15public set Checked(val: boolean) {
16 if (val != this._checked) {
17 this._checked = val;
18 this.draw(false);
19 }
20}
23public isChecked(): boolean {
24 return !!this.select('CHECKED_RADIO_ICON');
25}

Related snippets