<!doctype html>
<html lang="en">
<head>
<meta charset="gd2312">
<title>显示列表项内容</title>
<script type="text/javascript">
function $(id){return document.getElementById(id);}
function displayItem(){
var index=$("name").selectedIndex;
alert("教材名称:"+index+"<br/>"+"定价:"+$("name").options[index].value);
}
</script>
</head>
<body>
<h3 align="left">显示列表内容</h3>
<form>
<select size="5" id="name" onChange="displayItem()">
<option value="35元">计算机组成原理</option>
<option value="38元">数据结构</option>
<option value="43元">计算机网络</option>
<option value="40元">Java程序设计</option>
<option value="28元">算法设计</option>
</select>
</form>
</body>
</html>
