<head>
<style>
</style>
<script language=javascript>
function change()
{
if(document.sdtchoose.leixingchoose.value=='dankelianxi')
{
document.sdtchoose.dankelianxi.style='visibility:show';
document.sdtchoose.neibuceshi.style='visibility:hidden';
}
if(document.sdtchoose.leixingchoose.value=='neibuceshi')
{
document.sdtchoose.dankelianxi.style='visibility:hidden';
document.sdtchoose.neibuceshi.style='visibility:show';
}
if(document.sdtchoose.leixingchoose.value=='lilunzonghe')
{
document.sdtchoose.dankelianxi.style='visibility:hidden';
document.sdtchoose.neibuceshi.style='visibility:hidden';
}
if(document.sdtchoose.leixingchoose.value=='')
{
document.sdtchoose.dankelianxi.style='visibility:hidden';
document.sdtchoose.neibuceshi.style='visibility:hidden';
}
}
</script>
</head>
<body>
<form name='sdtchoose'>
<select name='leixingchoose' onChange='change()'>
<option value=''>----请选择----
<option value=dankelianxi>单科练习
<option value=neibuceshi>内部测试
<option value=lilunzonghe>理论综合模拟考试
<select>
<p>
<div >
<select name='dankelianxi' style='visibility:hidden'>
<option value=stb>软件技术基础
<option value=c>程序逻辑与C语言
<option value=sql&rdbms>SQL语言与关系型数据库基础
<option value=vb>VB可视化编程
<option value=html>网页编程
</select>
<select name='neibuceshi' style='visibility:hidden'>
<option value=1>stb&sql
<option value=2>c语言
</select>
</form>
</body>
</html>
2 个解决方案
#1
<html>
<head>
<style>
</style>
<script language=javascript>
function change()
{
if(GetSelectValue("leixingchoose")=='dankelianxi')
{
document.sdtchoose.dankelianxi.style.visibility='';
document.sdtchoose.neibuceshi.style.visibility='hidden';
}
if(GetSelectValue("leixingchoose")=='neibuceshi')
{
document.sdtchoose.dankelianxi.style.visibility='hidden';
document.sdtchoose.neibuceshi.style.visibility='';
}
if(GetSelectValue("leixingchoose")=='lilunzonghe')
{
document.sdtchoose.dankelianxi.style.visibility='hidden';
document.sdtchoose.neibuceshi.style.visibility='hidden';
}
if(GetSelectValue("leixingchoose").value=='')
{
document.sdtchoose.dankelianxi.style.visibility='hidden';
document.sdtchoose.neibuceshi.style.visibility='hidden';
}
}
function GetSelectValue(ObjectID)
{
ObjectID=eval("document.forms[0]."+ObjectID)
for(iIndex=0;iIndex<ObjectID.length;iIndex++)
{
if(ObjectID.options[iIndex].selected)
{
return ObjectID.options[iIndex].value;
}
}
return null;
}
</script>
</head>
<body>
<form name='sdtchoose'>
<select name='leixingchoosename' onChange='change()' id="leixingchoose">
<option value=''>----请选择----</option>
<option value=dankelianxi>单科练习</option>
<option value=neibuceshi>内部测试</option>
<option value=lilunzonghe>理论综合模拟考试</option>
<select>
<p>
<div >
<select name='dankelianxi' style='visibility:hidden'>
<option value=stb>软件技术基础
<option value=c>程序逻辑与C语言
<option value=sql&rdbms>SQL语言与关系型数据库基础
<option value=vb>VB可视化编程
<option value=html>网页编程
</select>
<select name='neibuceshi' style='visibility:hidden'>
<option value=1>stb&sql
<option value=2>c语言
</select>
</form>
</body>
</html>
<head>
<style>
</style>
<script language=javascript>
function change()
{
if(GetSelectValue("leixingchoose")=='dankelianxi')
{
document.sdtchoose.dankelianxi.style.visibility='';
document.sdtchoose.neibuceshi.style.visibility='hidden';
}
if(GetSelectValue("leixingchoose")=='neibuceshi')
{
document.sdtchoose.dankelianxi.style.visibility='hidden';
document.sdtchoose.neibuceshi.style.visibility='';
}
if(GetSelectValue("leixingchoose")=='lilunzonghe')
{
document.sdtchoose.dankelianxi.style.visibility='hidden';
document.sdtchoose.neibuceshi.style.visibility='hidden';
}
if(GetSelectValue("leixingchoose").value=='')
{
document.sdtchoose.dankelianxi.style.visibility='hidden';
document.sdtchoose.neibuceshi.style.visibility='hidden';
}
}
function GetSelectValue(ObjectID)
{
ObjectID=eval("document.forms[0]."+ObjectID)
for(iIndex=0;iIndex<ObjectID.length;iIndex++)
{
if(ObjectID.options[iIndex].selected)
{
return ObjectID.options[iIndex].value;
}
}
return null;
}
</script>
</head>
<body>
<form name='sdtchoose'>
<select name='leixingchoosename' onChange='change()' id="leixingchoose">
<option value=''>----请选择----</option>
<option value=dankelianxi>单科练习</option>
<option value=neibuceshi>内部测试</option>
<option value=lilunzonghe>理论综合模拟考试</option>
<select>
<p>
<div >
<select name='dankelianxi' style='visibility:hidden'>
<option value=stb>软件技术基础
<option value=c>程序逻辑与C语言
<option value=sql&rdbms>SQL语言与关系型数据库基础
<option value=vb>VB可视化编程
<option value=html>网页编程
</select>
<select name='neibuceshi' style='visibility:hidden'>
<option value=1>stb&sql
<option value=2>c语言
</select>
</form>
</body>
</html>
#2
<html>
<head>
<style>
</style>
<script language=javascript>
var lastSel = null;
function change()
{
var sel = document.getElementsByTagName("SELECT");
var obj = eval("document.all."+document.all.leixingchoose.value);
obj.style.display = '';
if(lastSel != null)
lastSel.style.display = "none";
lastSel = obj;
}
</script>
</head>
<body>
<form name='sdtchoose'>
<select id='leixingchoose' name='leixingchoose' onChange='change()'>
<option value=''>----请选择----
<option value=dankelianxi>单科练习
<option value=neibuceshi>内部测试
<option value=lilunzonghe>理论综合模拟考试
<select>
<p>
<div >
<select name='dankelianxi' id='dankelianxi' style='display:none'>
<option value=stb>软件技术基础
<option value=c>程序逻辑与C语言
<option value=sql&rdbms>SQL语言与关系型数据库基础
<option value=vb>VB可视化编程
<option value=html>网页编程
</select>
<select name='neibuceshi' id='neibuceshi' style='display:none'>
<option value=1>stb&sql
<option value=2>c语言
</select>
</form>
</body>
</html>
<head>
<style>
</style>
<script language=javascript>
var lastSel = null;
function change()
{
var sel = document.getElementsByTagName("SELECT");
var obj = eval("document.all."+document.all.leixingchoose.value);
obj.style.display = '';
if(lastSel != null)
lastSel.style.display = "none";
lastSel = obj;
}
</script>
</head>
<body>
<form name='sdtchoose'>
<select id='leixingchoose' name='leixingchoose' onChange='change()'>
<option value=''>----请选择----
<option value=dankelianxi>单科练习
<option value=neibuceshi>内部测试
<option value=lilunzonghe>理论综合模拟考试
<select>
<p>
<div >
<select name='dankelianxi' id='dankelianxi' style='display:none'>
<option value=stb>软件技术基础
<option value=c>程序逻辑与C语言
<option value=sql&rdbms>SQL语言与关系型数据库基础
<option value=vb>VB可视化编程
<option value=html>网页编程
</select>
<select name='neibuceshi' id='neibuceshi' style='display:none'>
<option value=1>stb&sql
<option value=2>c语言
</select>
</form>
</body>
</html>
#1
<html>
<head>
<style>
</style>
<script language=javascript>
function change()
{
if(GetSelectValue("leixingchoose")=='dankelianxi')
{
document.sdtchoose.dankelianxi.style.visibility='';
document.sdtchoose.neibuceshi.style.visibility='hidden';
}
if(GetSelectValue("leixingchoose")=='neibuceshi')
{
document.sdtchoose.dankelianxi.style.visibility='hidden';
document.sdtchoose.neibuceshi.style.visibility='';
}
if(GetSelectValue("leixingchoose")=='lilunzonghe')
{
document.sdtchoose.dankelianxi.style.visibility='hidden';
document.sdtchoose.neibuceshi.style.visibility='hidden';
}
if(GetSelectValue("leixingchoose").value=='')
{
document.sdtchoose.dankelianxi.style.visibility='hidden';
document.sdtchoose.neibuceshi.style.visibility='hidden';
}
}
function GetSelectValue(ObjectID)
{
ObjectID=eval("document.forms[0]."+ObjectID)
for(iIndex=0;iIndex<ObjectID.length;iIndex++)
{
if(ObjectID.options[iIndex].selected)
{
return ObjectID.options[iIndex].value;
}
}
return null;
}
</script>
</head>
<body>
<form name='sdtchoose'>
<select name='leixingchoosename' onChange='change()' id="leixingchoose">
<option value=''>----请选择----</option>
<option value=dankelianxi>单科练习</option>
<option value=neibuceshi>内部测试</option>
<option value=lilunzonghe>理论综合模拟考试</option>
<select>
<p>
<div >
<select name='dankelianxi' style='visibility:hidden'>
<option value=stb>软件技术基础
<option value=c>程序逻辑与C语言
<option value=sql&rdbms>SQL语言与关系型数据库基础
<option value=vb>VB可视化编程
<option value=html>网页编程
</select>
<select name='neibuceshi' style='visibility:hidden'>
<option value=1>stb&sql
<option value=2>c语言
</select>
</form>
</body>
</html>
<head>
<style>
</style>
<script language=javascript>
function change()
{
if(GetSelectValue("leixingchoose")=='dankelianxi')
{
document.sdtchoose.dankelianxi.style.visibility='';
document.sdtchoose.neibuceshi.style.visibility='hidden';
}
if(GetSelectValue("leixingchoose")=='neibuceshi')
{
document.sdtchoose.dankelianxi.style.visibility='hidden';
document.sdtchoose.neibuceshi.style.visibility='';
}
if(GetSelectValue("leixingchoose")=='lilunzonghe')
{
document.sdtchoose.dankelianxi.style.visibility='hidden';
document.sdtchoose.neibuceshi.style.visibility='hidden';
}
if(GetSelectValue("leixingchoose").value=='')
{
document.sdtchoose.dankelianxi.style.visibility='hidden';
document.sdtchoose.neibuceshi.style.visibility='hidden';
}
}
function GetSelectValue(ObjectID)
{
ObjectID=eval("document.forms[0]."+ObjectID)
for(iIndex=0;iIndex<ObjectID.length;iIndex++)
{
if(ObjectID.options[iIndex].selected)
{
return ObjectID.options[iIndex].value;
}
}
return null;
}
</script>
</head>
<body>
<form name='sdtchoose'>
<select name='leixingchoosename' onChange='change()' id="leixingchoose">
<option value=''>----请选择----</option>
<option value=dankelianxi>单科练习</option>
<option value=neibuceshi>内部测试</option>
<option value=lilunzonghe>理论综合模拟考试</option>
<select>
<p>
<div >
<select name='dankelianxi' style='visibility:hidden'>
<option value=stb>软件技术基础
<option value=c>程序逻辑与C语言
<option value=sql&rdbms>SQL语言与关系型数据库基础
<option value=vb>VB可视化编程
<option value=html>网页编程
</select>
<select name='neibuceshi' style='visibility:hidden'>
<option value=1>stb&sql
<option value=2>c语言
</select>
</form>
</body>
</html>
#2
<html>
<head>
<style>
</style>
<script language=javascript>
var lastSel = null;
function change()
{
var sel = document.getElementsByTagName("SELECT");
var obj = eval("document.all."+document.all.leixingchoose.value);
obj.style.display = '';
if(lastSel != null)
lastSel.style.display = "none";
lastSel = obj;
}
</script>
</head>
<body>
<form name='sdtchoose'>
<select id='leixingchoose' name='leixingchoose' onChange='change()'>
<option value=''>----请选择----
<option value=dankelianxi>单科练习
<option value=neibuceshi>内部测试
<option value=lilunzonghe>理论综合模拟考试
<select>
<p>
<div >
<select name='dankelianxi' id='dankelianxi' style='display:none'>
<option value=stb>软件技术基础
<option value=c>程序逻辑与C语言
<option value=sql&rdbms>SQL语言与关系型数据库基础
<option value=vb>VB可视化编程
<option value=html>网页编程
</select>
<select name='neibuceshi' id='neibuceshi' style='display:none'>
<option value=1>stb&sql
<option value=2>c语言
</select>
</form>
</body>
</html>
<head>
<style>
</style>
<script language=javascript>
var lastSel = null;
function change()
{
var sel = document.getElementsByTagName("SELECT");
var obj = eval("document.all."+document.all.leixingchoose.value);
obj.style.display = '';
if(lastSel != null)
lastSel.style.display = "none";
lastSel = obj;
}
</script>
</head>
<body>
<form name='sdtchoose'>
<select id='leixingchoose' name='leixingchoose' onChange='change()'>
<option value=''>----请选择----
<option value=dankelianxi>单科练习
<option value=neibuceshi>内部测试
<option value=lilunzonghe>理论综合模拟考试
<select>
<p>
<div >
<select name='dankelianxi' id='dankelianxi' style='display:none'>
<option value=stb>软件技术基础
<option value=c>程序逻辑与C语言
<option value=sql&rdbms>SQL语言与关系型数据库基础
<option value=vb>VB可视化编程
<option value=html>网页编程
</select>
<select name='neibuceshi' id='neibuceshi' style='display:none'>
<option value=1>stb&sql
<option value=2>c语言
</select>
</form>
</body>
</html>