yuzhould

就想找个设置html combobox或者select默认选项的代码,百度搜了半小时不知所云的内容,其实很简单,代码如下

js的方式:

var index = 你的下标

getElementById("id").selectedIndex= index ;

 

jqurey的方式:

var index = 你的下标

$("#id")[0].selectedIndex = index;

 

分类:

技术点:

相关文章: