我正在研究用于排名的多个下拉菜单。我从 stackoverflow 中找到了这个出色的代码:
它在 JSFiddle 上运行良好,但我似乎无法让代码在我的 Chrome 或 IE 浏览器中脱机工作。有人可以帮忙吗?
<script type="text/javascript">
$(document).ready(function() {
$(".go").change(function() {
var selVal = [];
$(".go").each(function() {
selVal.push(this.value);
});
$(this).siblings(".go").find("option").removeAttr("disabled").filter(function() {
var a = $(this).parent("select").val();
return (($.inArray(this.value, selVal) > -1) && (this.value != a))
}).attr("disabled", "disabled");
});
$(".go").eq(0).trigger('change');
});
</script>