Set the default selection of the select selection box

var wtfl = document.getElementById("wtfl1");
wtfl.options[0].selected = true;    //设置id=wtfl1默认选中的元素是第一个option

//设置value=1的选择项为被选择项
$("#wtfl3 option[value='1']").attr("selected", "selected");

Guess you like

Origin blog.csdn.net/qq_45844443/article/details/118379818