var isEnable=$("#isEnable").val();//获取回显的值, console.log("isEnable---"+isEnable) // 遍历select $("#isEnable").each(function() { // this代表的是<option></option>,对option再进行遍历 $(this).children("option").each(function() { // 判断需要对那个选项进行回显 if (this.value == isEnable) { console.log($(this).text()); // 进行回显 $(this).attr("selected","selected"); } }); })
layui 下拉回显
最新推荐文章于 2024-01-17 09:23:41 发布