onclick="document.all.select2.selectedIndex=0;"
解决方案 »
- js取servlet传过来的参数问题
- 为什么iis不提示"已限制此网页运行可以访问计算机的脚本或ActiveX控件..."
- 怎样用javascript显示月份日历
- 將函數寫入數據庫,怎麼讓它讀出來後能用?
- 如何在aspx页面中,插入一段代码,当页面调用完毕后,自动触发其中一个按钮。谢谢指教。
- 初学者的小问题。麻烦大家帮下忙
- 急救:我用鼠标拖动div时,怎么实现鼠标在此div的下面
- 请问如何做一个输出结果的JS 代码?
- 请指点---在线等
- 如何用在两次用getTime()中得到两个不同的时间。
- 在被打开窗口中,对父窗口的页面进行刷新。但要求焦点还要保持在被打开的窗口。
- “更新密码”的程序怎么写好?
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language="javascript">
function go(){
if (form1.select1.options[2].selected==true){
document.form1.select2.options.length=1;
}
}
</script>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<form name="form1">
<select name="select1" onchange="go()">
<option name="1" value="1">中国</option>
<option name="2" value="2">日本</option>
<option name="3" value="3">美国</option>
</select>
<select name="select2">
<option name="4" value="4">足球</option>
<option name="5" value="5">蓝球</option>
<option name="6" value="6">台球</option>
</select>
</form>
</body>
</html>此效果是当你选择美国时,另一个下拉里的选项回改变成只有一个不知道你是不是要的这个效果!
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language="javascript">
function go(){
if (form1.select1.options[2].selected==true){
document.form1.select2.options.length=1;}
}
</script>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<form name="form1">
<select name="select1" onchange="go()">
<option name="1" value="1">中国</option>
<option name="2" value="2">日本</option>
<option name="3" value="3">美国</option>
</select>
<select name="select2">
<option name="4" value="4">足球</option>
<option name="5" value="5">蓝球</option>
<option name="6" value="6">台球</option>
</select>
</form>
</body>
</html>当你选择美国时,另一个下拉里的选项会变成还有一个
不知道你要的是不是这个效果