关于css中树形的开闭以及复选框checkbox如何全选取消的实现
来源:互联网 发布:好看的美剧推荐 知乎 编辑:程序博客网 时间:2024/04/30 19:28
1,这种方法就是类似于在一般的网站左边有导航栏,然后有+ -显示或者折叠信息
<html><head><title>document示例--树状展开和关闭</title><script language="javascript" type="text/javascript"><!--function test1_onclick(){if(test1.innerText=="-"){myList.style.display="none";test1.innerText="+";}else{myList.style.display="block";test1.innerText="-";//怎样体现body的all这个对象的作用//因为你可以通赤body的all来访问body中所有的控件(通过id)//所以代码可以写成//document.body.all.test1.innerText="-";//document.body.all("text1").innerText="-";//document.body.all.item("text1").innerText="-";}}function test2_onclick(){if(test2.innerText=="-"){myNation.style.display="none";test2.innerText="+";}else{myNation.style.display="block";test2.innerText="-";//怎样体现body的all这个对象的作用//因为你可以通赤body的all来访问body中所有的控件(通过id)//所以代码可以写成//document.body.all.test1.innerText="-";//document.body.all("text1").innerText="-";//document.body.all.item("text1").innerText="-";}}//--></script></head><body><p style="background-color:pink"><FONT face="宋体" background-color="pink"><span id=test1 style="border-left-color:#ff0099;border-bottom-color:#ff0099;cursor:hand;border-top-style:ridge;border-right-color:#ff0099;border-bottom-style:ridge;" language=javascript onclick="return test1_onclick()">-</span>myFamily家庭成员的选择</FONT></p><ul id=myList><li><font face="宋体">爸爸</font></li><li><font face="宋体">妈妈</font></li><li><font face="宋体">弟弟</font></li></ul><p style="background-color:yellow"><FONT face="宋体"><span id=test2 style="border-left-color:#ff0099;border-bottom-color:#ff0099;cursor:hand;border-top-style:ridge;border-right-color:#ff0099;border-bottom-style:ridge" language=javascript onclick="return test2_onclick()">-</span>nations国家的选择</FONT></p><ul id=myNation><li><font face="宋体">中国</font></li><li><font face="宋体">美国</font></li><li><font face="宋体">日本</font></li></ul></body></html>
<!DOCTYPE html><html><head><title>复选框checkbox</title><script type="text/javascript" language="javascript">function selectCheck(obj){var fruits=document.getElementsByName("fruit");if(obj.innerText=="全选"){for ( var i = 0; i < fruits.length; i++) {fruits[i].checked = true;}}else{for ( var i = 0; i < fruits.length; i++) {fruits[i].checked = false;}}}//响应复选框的function selectCheck2(){var fruits=document.getElementsByName("fruit");if(myselect.checked){for ( var i = 0; i < fruits.length; i++) {fruits[i].checked = true;}}else{for ( var i = 0; i < fruits.length; i++) {fruits[i].checked = false;}}}</script></head><body><input type="checkbox" name="fruit" onclick="gouwu(this)" value="10" />苹果 10元<br><input type="checkbox" name="fruit" onclick="gouwu(this)" value="20" />香蕉 20元<br><input type="checkbox" name="fruit" onclick="gouwu(this)" value="30" />西瓜 30元<br><input type="checkbox" name="fruit" onclick="gouwu(this)" value="40" />栗子 40元<br><input type="checkbox" name="fruit" onclick="gouwu(this)" value="50" />哈密瓜 50元<br><a href="#" onclick="selectCheck(this)">全选</a><a href="#" onclick="selectCheck(this)">取消</a><br><input type="checkbox" id="myselect" onclick="selectCheck2()"/>是否全选</body></html><strong></strong>
0 0
- 关于css中树形的开闭以及复选框checkbox如何全选取消的实现
- 如何实现checkbox的全选/取消
- 关于Gridview中CheckBox全选的取消
- jquery实现复选框checkbox全选,取消全选
- 复选框的全选、取消
- 复选框的全选与取消全选
- DataGrid中CheckBox的全选/取消全选
- 如何用jquery实现checkbox的全选、反选、取消反选,以及如何得到选中的checkbox的值
- js实现多个复选框的全选与取消
- 使用js实现复选框的全选、取消功能
- 全选/取消 gridview中checkbox的功能实现
- 实现listview中checkbox的全选、反选和取消
- 用jquery实现复选框checkbox的全选
- android checkBox (复选框)简单例子,全选的实现
- jquery实现checkbox复选框的全选反选
- jquery实现复选框(checkbox)的全选与反选
- GridView中如何实现CheckBox的全选?
- html,javaScript中怎么控制复选框checkbox的全选,全不选,以及全选中,全选按钮选中,其中一个或者多个没选,则全选按钮不被选中
- bzoj1654 [Usaco2006 Jan]The Cow Prom 奶牛舞会
- python中的文档字符串(docString)
- ROC曲线
- POJ 题目分类
- 时间过的很快,在此暂时做个总结
- 关于css中树形的开闭以及复选框checkbox如何全选取消的实现
- IOS 开发小作品 通讯录
- php5-fpm在ubuntu下启动不了
- Code Frist学习笔记
- switch语句反汇编分析
- 如何测算出任一副图片中的物体的实际尺寸?
- 思维训练
- vijos 1768顺序对的值
- Qt5: how to handle fonts when deploying?