$("button").on("click", function() {
\t $("select option").each(function() {
\t $(this).addClass("heavyError");
});
$("select option:selected").attr("selected", false);
});
.heavyError {
color: red;
font-weight: bold;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<select style="width:480px; height:100px;" multiple>
<option value="test-ss">test-ss</option>
</select>
<button>test</button>
如果在IE中运行此部分后,该文本被用连字符切断,但是,它在Chrome中正常工作。不知道这里发生了什么。这是一个IE浏览器或某种类型的错误?
是的,我认为这是一个公关与IE浏览器(选择选项和多个) – Geeky
我试过这种类型的东西,并登陆在https://github.com/angular/angular.js/issues/11314 – Geeky
什么版本的IE浏览器? – epascarello