10 examples of 'unselect selected option jquery' in JavaScript

Every line of 'unselect selected option jquery' 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
this disclaimer
45public deSelect(item) {
46 const index = this.value.indexOf(item.text);
47 if (index >= -1) {
48 this.value.splice(index, 1);
49 }
50 this.result.emit(this.value);
51}
Important

Use secure code every time

Secure your code as it's written. Use Snyk Code to scan source code in minutes – no build needed – and fix issues immediately. Enable Snyk Code

100function unselect(target, value){
101 var state = $.data(target, 'combobox');
102 var opts = state.options;
103 var values = $(target).combo('getValues');
104 var index = values.indexOf(value+'');
105 if (index >= 0){
106 values.splice(index, 1);
107 setValues(target, values);
108 }
109 var item = findDataItem(state.data, opts.valueField, value);
110 if (item){
111 opts.onUnselect.call(target, item);
112 }
113}
45function unselectAll(form) {
46 $(form).find("input[type=checkbox]").attr("checked", false);
47}
1function toggle_select_all() {
2 $('#users ul').find('input').each(
3 function(){
4 if(!$(this).attr("checked")) {
5 $(this).attr("checked",true);
6 } else {
7 $(this).attr("checked",false);
8 }
9 }
10 );
11}
84deselect(): this {
85 this.selection = undefined;
86 return this;
87}
229function enableSelectOption($option) {
230
231 // given an already disabled select option, enable it
232
233 $option.removeClass(options.optionDisabledClass)
234 .attr("disabled", false);
235
236 if(options.hideWhenAdded) $option.show();
237 if($.browser.msie) $select.hide().show(); // this forces IE to update display
238}
23private selectedFunction (){
24 this.result.emit(this.value);
25}
92removeOption(selectObj, AtIndex) {
93 const fullResponse = {
94 resultFlag: false,
95 details: ''
96 };
97 if (AtIndex !== -1) {
98 selectObj.rows.splice(AtIndex, 1);
99 fullResponse.resultFlag = true;
100 fullResponse.details= '';
101 return fullResponse;
102 } else {
103 fullResponse.resultFlag = false;
104 fullResponse.details= 'Option index not valid';
105 return fullResponse;
106 }
107}
269public unselect() {
270 this._selected = false;
271 this._element.classList.remove('selected');
272}
49function disableSelect(chkbox) {
50 var sibling = chkbox;
51 while (sibling != null) {
52 if (sibling.nodeType == 1 && sibling.tagName.toLowerCase() == "select") {
53 $(sibling).prop('disabled', !chkbox.checked);
54 }
55 sibling = sibling.previousSibling;
56 }
57}

Related snippets