📜  选项从数组中选择 - C++ 代码示例

📅  最后修改于: 2022-03-11 14:44:56.844000             🧑  作者: Mango

代码示例3
var states = new Array();
states['India'] = new Array('Andhra Pradesh','Arunachal Pradesh','Assam','Bihar','Chhattisgarh','Goa','Gujarat','Haryana','Himachal Pradesh','Jammu and Kashmir','Jharkhand','Karnataka','Kerala','Madhya Pradesh','Maharashtra','Manipur','Meghalaya','Mizoram','Nagaland','Odisha','Punjab','Rajasthan','Sikkim','Tamil Nadu','Telangana','Tripura','Uttar Pradesh','Uttarakhand','WestBengal','Andaman and Nicobar Islands','Chandigarh','Dadra and Nagar Haveli','Daman and Diu','Lakshadweep','Puducherry'); 

function setStates() {
    var newOptions=states['India'];
    var newValues=states['India'];
    selectField = document.getElementById("state");
    selectField.options.length = 0;
    for (i=0; i