<!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(sel[sid].value+'-'+sel[sid].innerHTML);
}
</script>
</html>
jq的话就一句
$("#sel option:selected").text();
$("#sel option:selected").val();
版权属于:
千古互动
文章声明:
本文版权内容属于《千古互动》转载请标明出处