日期:2014-05-16 浏览次数:20399 次
function cgtest()
{
var level=$("#SelectM").val();
alert(level);//不管怎么选择下拉列框,每次打印出来都是3
}
<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js">
</script>
<script>
$(document).ready(function(){
$("p").click(function(){
$(this).hide();
});
});
function cgtest(){
alert($("#SelectM").val());
}
</script>
</head>
<body>
<select id="SelectM" style="width:170px" onchange="cgtest()"name="SelectM">
<option value="0">普通</option>
<option value="1">vip1</option>
<option value="2">vip2</option>
<option value="3" selected="selected">vip3</option>
<option value="4">vip4</option>
<option value="5">vip5</option>
</select>
<p>如果您点击我,我会消失。</p>
<p>点击我,我会消失。</p>
<p>也要点击我哦。</p>
</body>
</html>
<!DOCTYPE HTML>
<html>
<head>
<meta charset="gbk" />
<title></title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<style>
</style>
</head>
<body>
<select name="test" id="test">
<option value="1">1</option>
<option value="2">2</option>
<option value="3"&