html combobox select控件設置默認選項
就想找個設置html combobox或者select默認選項的代碼,百度搜了半小時不知所云的內容,其實很簡單,代碼如下
js的方式:
var index = 你的下標
getElementById("id").selectedIndex= index ;
jqurey的方式:
var index = 你的下標
$("#id")[0].selectedIndex = index;
就想找個設置html combobox或者select默認選項的代碼,百度搜了半小時不知所云的內容,其實很簡單,代碼如下
js的方式:
var index = 你的下標
getElementById("id").selectedIndex= index ;
jqurey的方式:
var index = 你的下標
$("#id")[0].selectedIndex = index;