单击列表框中的项目后,我将执行此处理,然后我需要删除此选择,因为它是第一次,以便我可以再次单击相同的项目并触发所选索引更改的事件.
将selectedIndex属性设置为-1:
// Plain JS:
document.getElementById("myList").selectedIndex = -1;
// Using jQuery to select the element:
$("#myList")[0].selectedIndex = -1;
Run Code Online (Sandbox Code Playgroud)
工作演示:http://jsfiddle.net/n84AW/