<meta charset="utf-8">
<select size="5" id="ccc">
</select>
<script>
var cData = [
[
['青羊', '武侯'],
['西昌', '冕宁'],
],
[
['天河', '越秀'],
['华强北', '华强南'],
],
];
function func(n,index) {
if (cData[n][index]) {
var len = cData[n][index].length;
for (var i = 0; i < len; i++) {
var o = document.createElement('option');
o.innerHTML = cData[n][index][i];
o.value = i;
ccc.appendChild(o);
}
}
}
</script>
<br />
<button onclick="func(0,0);">下标[0][0]</button>
<button onclick="func(0,1);">下标[0][1]</button>
<br />
<button onclick="func(1,0);">下标[1][0]</button>
<button onclick="func(1,1);">下标[1][1]</button>
对象 | 描述 |
---|---|
Array 对象 | |
Boolean 对象 | |
Date 对象 | |
Math 对象 | |
Number 对象 | |
String 对象 | |
RegExp 对象 | |
全局属性和函数 |
对象 | 描述 |
---|---|
Window 对象 | |
Navigator 对象 | |
Screen 对象 | |
History 对象 | |
Location 对象 |
对象 | 描述 |
---|---|
HTML Document | |
HTML Element | |
HTML Attributes | |
HTML Events |
对象 | 描述 |
---|---|
Anchor 对象 | |
Area 对象 | |
Base 对象 | |
Body 对象 | |
Frame/IFrame 对象 | |
Frameset 对象 | |
Link 对象 | |
Meta 对象 | |
Object 对象 |
Image 对象 | |
Option 对象 | |
Select 对象 | |
Style 对象 | |
Table 对象 | |
td / th 对象 | |
tr 对象 | |
Button 对象 | |
Form 对象 | |
Textarea 对象 |
Input Button 对象 | |
Input Checkbox 对象 | |
Input File 对象 | |
Input Hidden 对象 | |
Input Password 对象 | |
Input Radio 对象 | |
Input Reset 对象 | |
Input Submit 对象 | |
Input Text 对象 |
Input Range 对象 | |
Input Number 对象 | |
Input Date 对象 | |
Input Datetime 对象 | |
Input Datetime-local 对象 | |
Input Email 对象 | |
Input Month 对象 | |
Input Search 对象 | |
Input Tel 对象 | |
Input Time 对象 | |
Input Url 对象 | |
Input Week 对象 |