一个关于select标签的index默认选择问题
$("#sltFlag option").each(function (index, item) { $(item).removeAttr("selected"); if ($(item).val() == "1") { $(item).attr("selected", "selected"); } });