从request里取值初始化Select控件
程序员文章站
2024-02-21 18:43:22
...
var ttSelect = document.getElementById("travelType");
var option = ttSelect.options;
var tt = '<%=request.getAttribute("travelType")%>';
for(var i=0; i<option.length; i++)
{
if( option[i].value == tt )
{
option[i].selected = true;
}
}