这样的JS效果如何做出来

WBOY
Release: 2016-06-13 10:00:52
Original
956 people have browsed it

这样的JS效果怎么做出来?
一个表单中有

列表,数目未知
我想让用户点下某个按钮就把选中的取消,没选中的就选中,怎么弄呢?

------解决方案--------------------










------解决方案--------------------
if (mycols[i].checked==true){
mycols[i].checked=false;
} else {
mycols[i].checked=true;
}

这段这么麻烦

mycols[i].checked = mycols[i].checked ? false : true;
------解决方案--------------------





部分全选


部分反选


Item1



Item2


Item3


Item4


Item5




两种方案
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!