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

forms - Secure PHP File Upload Script -

c# - Regex Problems, extracting data to groups -

silverlight - SL4 - TextTrimming in DataGridRowGroupHeader -