html combobox select控件设置默认选项

时间:2015-11-30 20:25:39   收藏:0   阅读:1150

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

js的方式:

var index = 你的下标

getElementById("id").selectedIndex= index ;

 

jqurey的方式:

var index = 你的下标

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

 

原文:http://www.cnblogs.com/yuzhould/p/5008000.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!