我的script代码如下,
function getleve(){ var levelObj = document.getElementById("leve"); var pfObj = document.getElementById("PF"); var levelValue = levelObj.value; pfObj.innerHTML=''; $.get('petTypeServlet?action=pf',{id:levelValue},function(data){ }); }然后这是两个下拉列表
<select name="leve" id="leve" onchange="getleve();">
<option value="2">2</option>
<option value="3">3</option>
</select>
<td align="left"><select name="PF" id="PF" >
</select>
后台返回数据格式如下:
[{"PtID":1,"PtName":"陆上宠物","PtLevel":1,"PtFid":0},{"PtID":9,"PtName":"海洋宠物","PtLevel":1,"PtFid":0},{"PtID":10,"PtName":"空中宠物","PtLevel":1,"PtFid":0}]
请问怎么把下拉列表值设为PtID,显示为PtName,谢谢大家