<select id="type" name="type" title="智能設計參數設計類型"> <option value="請選擇" disabled>請選擇</option> <option value="01">格局和功能</option> <option value="02">風格</option> <option value="03">顏色</option> <option value="04">預算</option> </select>
//下拉列表改變事件 $("#type").change(function () { //要執行的代碼操做 }).mousedown(function () { //當按下鼠標按鈕的時候 this.sindex = $(this)[0].selectedIndex; $(this)[0].selectedIndex = 0; //把當前選中的值得索引賦給下拉選中的索引 }).mouseout(function () { //當鼠標移開的時候 if ($(this)[0].selectedIndex === 0) { //若是爲0,就是根本沒有選 $(this)[0].selectedIndex = this.sindex; //就把下拉選中的索引改變成以前選中的值得索引,就默認選擇的是以前選中的 } });
當你重複點擊同一項的時候,你會發現根本不會執行onchange方法.你們能夠依照上面的方法,就能夠實現重複點擊的時候也可以實現onchange方法了,有關select事件的一些用法函數,請看個人另外一篇博文https://my.oschina.net/u/2306318/blog/1551225函數