<!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.111cn.net/tr/xhtml1/dtd/xhtml1-transitional.dtd">
<html xmlns="http://www.111cn.net/ 1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=gb2312" />
<title>js获取select(下拉框的值)的值</title>
<script language="网页特效">
function selectvalue()
{
var t = document.getelementbyid("test");
alert(t.options[t.selectedindex].value);
}
</script>
</head><body>
<select name="test" id="type" onchange="alert(this.options[selectedindex].value);">
<option value="0">请选择</option>
<option value="获取select的值1">获取select的值1</option>
<option value="获取select的值二">获取select的值二</option>
<option value="获取select的值三">获取select的值三</option>
<option value="获取select的值四">获取select的值四</option>
</select> <br /><a href="javascript:selectvalue();">获取select的值</a>
例如,要获得"第一"
例:document.getelementbyid('type').options[document.getelementbyid('type').selectedindex].text;
</body>
</html>