从request里取值初始化Select控件
程序员文章站
2024-02-21 17:46:46
...
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;
}
}