◆ 载入页面SELECT标签默认为空
<body onload="load()">
<select id="abc" >
<option >1</option>
<option >2</option>
<option >3</option>
<option >4</option>
</select>
</body>
<script>
function load(){
var x = document.getElementById("abc");
x.selectedIndex = -1;
}
</script>
使用css方式:
<select id="abc" >
<option selected="selected" disabled="disabled" style='display: none' value=''></option>
<option >1</option>
<option >2</option>
<option >3</option>
<option >4</option>
</select>
◆ 获取select标签选中的值:
var obj = document.getElementByIdx_x(”testSelect”); //定位id
var index = obj.selectedIndex; // 选中索引
var text = obj.options[index].text; // 选中文本
var value = obj.options[index].value; // 选中值