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

delphi - TJvHidDeviceController "DevicePath" always showing "\" -

web applications - Making Python scripts work on MAMP -

cocoa - Converting NSString to keyCode+modifiers for AXUIElementPostKeyboardEvent -