<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
</head>
<body>
<select id="sel" onchange="cge()">
<option value="1">4</option>
<option value="2">5</option>
<option value="3">6</option>
</select>
</body>
<script>
function cge(){
var sel=document.getElementById('sel');
var sid=sel.selectedIndex;
alert('value值:'+sel[sid].value+',option值:'+sel[sid].innerHTML);
}
</script>
</html>
js获取select option中的值或者value值
于 2019-05-26 00:06:24 首次发布