js+div 实现多选 通过js控制div层,实现多选.例如;按钮 div层A --AB --BC --C就是说点 A div层实现对A的显示,再此点A 对应的div隐藏.如果 我点了A\B\C 三个 就出现三个 相应的 A\B\C的 div层 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 div1.style.display="none";div1.style.display=""; 一个小例子:<html><head><script language=javascript>function show(divName){ var obj = document.getElementById(divName).style.display; document.getElementById(divName).style.display=(obj=="none")?"":"none";}</script></head><body> <input type=button value=A onclick="show('A');"/> <input type=button value=B onclick="show('B');"/> <input type=button value=C onclick="show('C');"/> <div id=A>A</div> <div id=B>B</div> <div id=C>C</div></body></html> 分别为三个DIV设置一个ID名:<div id ="a" >你要显示的内容</div><div id ="b" >你要显示的内容</div><div id ="c" >你要显示的内容</div>三个按钮:<input type="button" name = "aa" value="A" onclick = "a()"/><input type="button" name = "bb" value="B" onclick = "b()"/><input type="button" name = "cc" value="C" onclick = "c()"/><script language="javascript">function a(){ document.form.all("a").style.visibility="visible";}function b(){ document.form.all("b").style.visibility="visible";}function c(){ document.form.all("c").style.visibility="visible";} </script> 迷茫中,求大牛指点,非技术问题,比较长,无耐心勿进!! 模态对话框问题 tomcat配置虚拟目录时出错 org.springframework.beans.factory.BeanCreationException: 关于javascript的navigator.userLanguage问题,谢谢 请教weblogic9.2配置数据源 在线求急 dwr 查询 jsp显示 求一函数 只用来做javaBean没有main函数的.java是不是不能编译? 一个调试的问题 帮我解决好吗 jsp 中返回页面上一页面 并刷新 如何将Byte[]保存成一个文件 比如.doc的文件?
div1.style.display="";
<html>
<head>
<script language=javascript>
function show(divName){
var obj = document.getElementById(divName).style.display;
document.getElementById(divName).style.display=(obj=="none")?"":"none";
}
</script>
</head>
<body>
<input type=button value=A onclick="show('A');"/>
<input type=button value=B onclick="show('B');"/>
<input type=button value=C onclick="show('C');"/>
<div id=A>A</div>
<div id=B>B</div>
<div id=C>C</div>
</body>
</html>
<div id ="a" >你要显示的内容</div>
<div id ="b" >你要显示的内容</div>
<div id ="c" >你要显示的内容</div>
三个按钮:
<input type="button" name = "aa" value="A" onclick = "a()"/>
<input type="button" name = "bb" value="B" onclick = "b()"/>
<input type="button" name = "cc" value="C" onclick = "c()"/><script language="javascript">
function a(){
document.form.all("a").style.visibility="visible";
}
function b(){
document.form.all("b").style.visibility="visible";
}
function c(){
document.form.all("c").style.visibility="visible";
}
</script>