JS驱动下拉列表出问题
问题是这样的:
<script>
function $(id) { return document.getElementById(id); };
function settingsCallback(o) {
if ($('txtVer')) $('txtVer').value = o.ver;
if ($('txtMac')) $('txtMac').value = o.mac;
if ($('txtIp')) $('txtIp').value = o.ip;
if ($('txtSub')) $('txtSub').value = o.sub;
if ($('txtGw')) $('txtGw').value = o.gw;
if ($('txtProtecalType')) $('txtProtecalType').value = o.pt;
if ($('SProtecalType')) $('SProtecalType').value= JSON.parse(o.pt);
};
</script>
<select name=\"SProtecalType\" id="SProtecalType" size='1'>
<option value =\"0\">0:通用类型</option>
<option value =\"1\">1:902TCP</option>
<option value =\"2\">2:608UDP</option>
<option value =\"3\">3:608UDP CLI</option>
<option value =\"4\">4:APP UDP</option>
</select>
参数已经传递过来了,我通过if ($('txtProtecalType')) $('txtProtecalType').value = o.pt;在一个文本框中调试的,就是无法选择列表,不会java真糟糕啊,请大神们赐教