Home > Web Front-end > JS Tutorial > How to use js to achieve all selection and none selection_javascript skills

How to use js to achieve all selection and none selection_javascript skills

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-05-16 17:06:04
Original
901 people have browsed it

js:

复制代码 代码如下:

function checkAll(name) {
var el = document.getElementsByTagName('input');
var len = el.length;
for(var i=0; iif((el[i].type=="checkbox") && (el[i].name==name)){
el[i].checked = true;
}
}
}
function clearAll(name) {
var el = document.getElementsByTagName('input');
var len = el.length;
for(var i=0; iif((el[i].type=="checkbox") && (el[i].name==name)){
el[i].checked = false;
}
}

}

html:
复制代码 代码如下:

全选
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
Latest Issues
Where is js written?
From 1970-01-01 08:00:00
0
0
0
js addClass not working
From 1970-01-01 08:00:00
0
0
0
js file code not found
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template