开发者

I can't clear the SELECT list with "selectedIndex = -1" in Internet Explorer 8

开发者 https://www.devze.com 2022-12-29 09:27 出处:网络
after an hour of trying to fin开发者_开发百科d a solution, I give up (temporarily). \"this.selectedIndex = -1\" clears all select element just fine in FF and other browsers, but NOT in Internet Explor

after an hour of trying to fin开发者_开发百科d a solution, I give up (temporarily). "this.selectedIndex = -1" clears all select element just fine in FF and other browsers, but NOT in Internet Explorer 8.

any idea how to clear select elements in IE?

thanks!


Rather than having a dropdown point to an invalid option, the standard solution is to have the first option of the dropdown say something like "(select)", so you can just reset to 0 if necessary

0

精彩评论

暂无评论...
验证码 换一张
取 消