<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script type="text/javascript">
function getTest(){
var obj=document.getElementById("t1");
//alert(obj);
var index=obj.selectedIndex;
// alert(index);
var text=obj.options[index].text;
alert(text);
var value=obj.options[index].value;
alert(value);
}
</script>
</head>
<body>
<select id="t1" name="jobname" οnchange="getTest();">
<option value="China">中国</option>
<option value="USA">美国</option>
<option value="English">英国</option>
</select>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script type="text/javascript">
function getTest(){
var obj=document.getElementById("t1");
//alert(obj);
var index=obj.selectedIndex;
// alert(index);
var text=obj.options[index].text;
alert(text);
var value=obj.options[index].value;
alert(value);
}
</script>
</head>
<body>
<select id="t1" name="jobname" οnchange="getTest();">
<option value="China">中国</option>
<option value="USA">美国</option>
<option value="English">英国</option>
</select>
</body>
</html>