<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<select id='a'>
<option value="1">1</option>
<option value="2">1</option>
</select>
<button id='b'>11</button>
</body>
<script type="text/javascript">
document.getElementById('b').onclick=function(){
var a = document.getElementById('a');
var index = a.selectedIndex;
var va = a.options[index].value;
alert(va);
}
</script>
</html>
网友评论