10 examples of 'jquery checkbox event' in JavaScript

Every line of 'jquery checkbox 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}
2635function handleCheckboxMultiselectClickOnCheckbox(e)
2636{
2637 var cb = e.currentTarget,
2638 value = cb.get('value'),
2639 select = cb.ancestor('.checkbox-multiselect').next('select');
2640
2641 Y.some(Y.Node.getDOMNode(select).options, function(o)
2642 {
2643 if (o.value == value)
2644 {
2645 o.selected = cb.get('checked');
2646 return true;
2647 }
2648 });
2649}
8function getClickEventCheckbox(event, checkboxId) {
9 var hasClickedCheckBox = event.target.type === 'checkbox';
10
11 if (hasClickedCheckBox) {
12 return $(event.target);
13 }
14
15 return $('#' + checkboxId);
16}
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}
12function uncheckCheckBox(checkbox){
13 $(checkbox).removeAttr("checked");
14}
82onCheckboxChange(event: any) {
83 event.stopPropagation();
84 this.change.emit(this.changeEvent);
85}
78function set_checkbox_value(id, value) {
79 $('#' + id).prop('checked', value);
80}
83toggle(event: MouseEvent) {
84 if (this.enabled) {
85 this.checked(!this.checked())
86 if (this._domInput) {
87 this._domInput.focus()
88 }
89 }
90 event.stopPropagation()
91}
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}

Related snippets