话不多说,请看下面代码
1
2
3
4
5
6
7
|
var row = [{ "code" : "1" , "model" : "APOLLO" }, { "code" : "2" , "model" : "APOLLO M/B1" }];
for ( var i = 0; i < row.length; i++) {
var addOption = document.createElement( "option" );
addOption.text = row[i][ "model" ];
addOption.value = row[i][ "model" ];
document.getElementById( "ddlModel" ).add(addOption);
}
|
1
2
3
|
< asp:DropDownList ID = "ddlModel" name = "ddlModel" runat = "server" Font-Size = "9pt" Width = "105px"
CssClass = "DropDownList" >
</ asp:DropDownList >
|
以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,如果有疑问大家可以留言交流,同时也希望多多支持服务器之家!
原文链接:http://www.cnblogs.com/lengzhan/p/6043404.html