Home > Web Front-end > JS Tutorial > body text

3分钟写出来的Jquery版checkbox全选反选功能_jquery

WBOY
Release: 2016-05-16 17:18:57
Original
920 people have browsed it
复制代码 代码如下:

//反选
function selectnoALL() {
$("input:checkbox").each(function (i) {
if (this.checked) {
this.checked = false;
} else {
this.checked = true;
}
});
}
//全选
function selectALL() {
var chelength = $("input:checkbox").length;
$("input:checkbox").each(function (i) {
if (i this.checked = true;
}
});
}

3分钟写出来的 估计很多bug
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!