function setSelectIndexByValue(e, value) { for(var x in e.options) { if(e.options[x].value == value) { e.selectedIndex = x; } } }
--------------------------------------------------------------------------------------------
var selectObject = document.getElementById('selectObject');
var value = 'qqqqqqqqqq';
setSelectIndexByValue(selectObject , value);
沒有留言:
發佈留言