How to remove selection from a listbox in html by javascript and jQuery? -


after click item on listbox, i'll processing need remove selection @ first time can click same item again , fire event of selected index change.

set selectedindex property -1:

// plain js: document.getelementbyid("mylist").selectedindex = -1;  // using jquery select element: $("#mylist")[0].selectedindex = -1; 

working demo: http://jsfiddle.net/n84aw/


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -