返回首页

分裂国家:国家代码的方法|我有一个数组,其中包含世界
所有国家比如我有3个国家。

var option_str = document.getElementById('country');

country_array[0]="USA|India|Australia";

 

var mySplitResult = country_array[0].split("|");

 

 for (var i = 0; i < mySplitResult.length; i++) {

	        option_str.options[i] = new Option(mySplitResult[i],mySplitResult[i]);

	    }

我已经使用分割法获得每个国家

,我prvios来源是
{C}
后excute这个查询
出来放是

<select name ="country" id = "country">

<option>USA</option>

<option>India</option>

<option>Australia</option>

</select>

但我希望做一些像这样的事情:
{体C3}
什么是代码或在那里我可以修改我的代码,会看到类似上面的
但你可以在阵列中使用国家代码

回答