1: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2: <html xmlns="http://www.w3.org/1999/xhtml">
3: <head>
4: <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5: <title>无标题文档</title>
6: <script src="../jquery-1.5.2.min.js" type="text/javascript" language="javascript"> 1:
</script> 1:
2: <script type="text/javascript" language="JavaScript" src="../dialog.js">
</script> 1:
2: <style type="text/css">
3: #test {
4: height: 20px;
5: width: 120px;
6: }
7: </style></head>
8:
9: <script type="text/javascript">
10: var mycars=new Array();
11: mycars[0]="1";
12: mycars[1]="2";
13: mycars[2]="4";
14: mycars[3]="5";
15: mycars[4]="6";
16: mycars[5]="7";
17: for(var i=0 ;i < mycars.length ; i++)
18: {
19: mycars[i]=mycars[i]+"号逆变器";
20: }
21:
22: function ajaxArea(){
23:
24: for(var a=0;a<mycars.length;a++){
25: //document.getElementById("test").options.add(new Option(mycars[a],mycars[a]));
26: document.getElementById("test").options.add(new Option(mycars[a],a ));
27: }
28:
29: }
</script> 1:
2: <body onload="ajaxArea()">
3: <select id="test">
4: </select>
5: <script type="text/javascript">
6:
</script>
7: </body>
8: </html>