定义的select如下:
<td><select id ="selModel" onchange="javascript:SelectModelChange();" style ="width:160px;"> <option value="Citizen_Policeman02.Xpc" title="../model/Citizen_Policeman.png">警察</option> <option value="Citizen_Female01.Xpc" title="../model/Citizen_Female.ico">市民</option> <option value="Car.xpc" title="../model/Car.png">汽车</option> <option value="Airplane.xpc" title="../model/Airplane.png">飞机</option> <option value="Ship.fpc" title="../model/Ship.png">轮船</option> <option value="" title ="../model/More.png" onclick ="javascript:SelectMoreModel();">更多...</option> </select> </td>
在 <script>中写的方法:
function SelectMoreModel() {
var sel = document.getElementById('selModel');
var value = showModalDialog("ModelList.aspx?rand=" + GetRandom(), "", "dialogWidth:250px; dialogHeight:500px; status:0; scroll:0;");
alert(value);
if (value != null) {
var opt = document.createElement('option');
opt.setAttribute('value', value);
opt.innerText = value;
opt.selected = true;
sel.appendChild(opt);
}
document.getElementById("ScaleFactor").value = "0.2";
document.getElementById("Height").value = "12";
document.getElementById("Speed").value = "10";
document.getElementById("TurnSpeed").value = "90";
}
我想在点击“更多...”选项的时候跳转到
ModelList.aspx页面,选择一个模型,然后返回一个值给value,这个值就是新增<option>的值,但是运行时不起作用。
慕姐4208626
明月笑刀无情
喵喔喔
相关分类