jQuery设置select选中项

// 设置选中项
function setSelected(value) {
    if (value) {
        $("select").children("option").each(function () {
            var temp_value = $(this).val();
            $(this).removeAttr("selected");
            if (temp_value === value) {
                $(this).attr("selected", "selected");
            }
        });
    }
}
原文地址:https://www.cnblogs.com/yongtaochang/p/14891865.html