10 examples of 'jquery checkbox checked event' in JavaScript

Every line of 'jquery checkbox checked event' 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
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}
12function uncheckCheckBox(checkbox){
13 $(checkbox).removeAttr("checked");
14}
78function set_checkbox_value(id, value) {
79 $('#' + id).prop('checked', value);
80}
82onCheckboxChange(event: any) {
83 event.stopPropagation();
84 this.change.emit(this.changeEvent);
85}
74function set_radio_checked(id) {
75 $('#' + id).prop('checked', true);
76}
189function handleCheckboxChange (e) {
190 // TODO: keep track of selected items/rows, for now just output
191 let checkbox = e.currentTarget;
192 // TODO: this seems very fragile, what if HTML hierarchy changes? Need better way.
193 checkbox.parentNode.parentNode.parentNode.classList.toggle('active');
194
195 let msg = (checkbox.checked ? "Selected: " : "Unselected: ") + checkbox.value;
196 let event = new CustomEvent('RowSelectionChanged', {"value": msg});
197 event.initCustomEvent('RowSelectionChanged', true, true, {"value": msg});
198 this.dispatchEvent(event);
199}
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}
35_checkboxChanged(e) {
36 const target = e.path[0];
37 const category = target.getAttribute('category');
38 const name = target.hasAttribute('name') ? target.getAttribute('name') : target.innerText.trim();
39 checklist.value[category].find(task => {
40 if (task.name === name) {
41 task.complete = target.checked;
42 return true;
43 }
44
45 return false;
46 });
47}
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}

Related snippets