<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<title> new document </title>
<script language="
javascript" src="js/menu.js"></script>
</head>
<body>
<table>
<tr>
<td>
<form method="post" action="#">
查询类型<select id="selectType" name="selectType" onchange="isChang1(this.value)">
<option value="yxsh">按院系</option>
<option value="zgh">职工号</option>
<option value="xm">姓名</option>
</select>
<span id="yxsh" style=display:>院系
<select id="depart" name="depart">
<option value="all">所有院系</option>
<option value="123">123</option>
<option value="123">123</option>
<option value="123">123</option>
<option value="123">123</option>
<option value="123">123</option>
</select>
课程分配
<select id="isAll" name="isAll">
<option value="all">所有</option>
<option value="NO">未分配</option>
<option value="YES">已分配</option>
</select>
</span>
<span id="key" style=display:none>
<input type="text" name="keyword" id="keyword"/>
</span>
<input type="submit" value="查询"/>
</form>
</BODY>
</HTML>
//这是用了自定义的方法hideElement()和shwoElement()
function isChang(values)
{
if(values=="yxsh"){
hideElement("key");
showElement("yxsh");
}else{
hideElement("yxsh");
showElement("key");
}
}
//自定义方法hideElement()
function hideElement(id){
document.getElementById(id).style.display="none";
}
//自定义方法showElement()
function showElement(id){
document.getElementById(id).style.display="";
}
//这是不用
自定义函数直接设置是否隐藏
function isChang1(values)
{
if(values=="yxsh"){
document.getElementById("yxsh").style.display="";
document.getElementById("key").style.display="none";
}else{
document.getElementById("yxsh").style.display="none";
document.getElementById("key").style.display="";
}
}