在ie6以上,我们可以通过
$("#selectID").val("xx");来个一个select控件赋值。但是在ie6下面会报错!!我们可以通过I下面方法来,使用方法:set_select_val($("#selectID" ),xx);//因为ie6不支持$("#" + provinceDom).attr("value", provinceDefvalue);
function set_select_val(sel, val) {
if ($.browser.msie && $.browser.version == "6.0") {
setTimeout(function () {
sel.val(val);
}, 1);
} else {
sel.val(val);
}
}
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn