虽然其他浏览器看起来不错,但 IE7 对我的 10 行 javascript 并不友好。
所有(小)代码都可以在这里找到:http: //jsfiddle.net/7nGd9/
$(function() {
$('#prepareSpecificProgressModal')
.each(function(index, modal) {
var
modal = $(modal),
form = $('#myform');
form.on('change', 'select', function(){
var node = $(this);
node
.closest('form')
.find('select').not(this)
.each(function(i, element){
element.selectedIndex = -1;
});
});
});
});
我$(element).val('');
用来重置选项的选择,但它在 IE7 下不起作用。基本上它允许在 3 个选择中进行多项选择,即使有 JS 应该阻止它。
感谢您的任何建议。