当前位置:网站首页>复选框的使用:全选,全不选,选一部分
复选框的使用:全选,全不选,选一部分
2022-07-03 02:56:00 【一尾流鸢cd】
function ck(n){
//获取全部复选框
var cks = document.getElementsByName("checkbox");
//获取全选的复选框
var ckz=document.getElementById("checkboxs");
var m = 0;//计算勾选商品的个数
if (n!=-1) {
//判断是否为全选按钮
ckz.checked=false;//不是全选按钮,按钮设置为false
for (var i = 0; i < cks.length; i++) {
if (cks[i].checked) {
m++;
}
}
if (m==cks.length){
ckz.checked=true;
}
}else {
for (var i = 0; i < cks.length; i++) {
cks[i].checked = ckz.checked;
m++;
}
}
}
n为标记用来区分是全选复选框,某个复选框
边栏推荐
- [fluent] futurebuilder asynchronous programming (futurebuilder construction method | asyncsnapshot asynchronous calculation)
- 你真的懂继电器吗?
- 为什么会选择框架?选择什么样的框架
- TCP 三次握手和四次挥手机制,TCP为什么要三次握手和四次挥手,TCP 连接建立失败处理机制
- Pytest (6) -fixture (Firmware)
- Counter统计数量后,如何返回有序的key
- Can netstat still play like this?
- JS finds all the parent nodes or child nodes under a node according to the tree structure
- Didi programmers are despised by relatives: an annual salary of 800000 is not as good as two teachers
- Error invalid bound statement (not found): com ruoyi. stock. mapper. StockDetailMapper. XXXX solution
猜你喜欢

MATLAB小技巧(24)RBF,GRNN,PNN-神经网络

Random shuffle note
![[translation] the background project has joined the CNCF incubator](/img/0b/e3d2674b1a1cba3ea398cbcb1a018a.png)
[translation] the background project has joined the CNCF incubator

xiaodi-笔记

【Flutter】shared_ Preferences local storage (introduction | install the shared_preferences plug-in | use the shared_preferences process)
![ASP. Net core 6 framework unveiling example demonstration [02]: application development based on routing, MVC and grpc](/img/cb/145937a27ef08050a370d5a255215a.jpg)
ASP. Net core 6 framework unveiling example demonstration [02]: application development based on routing, MVC and grpc

Basic operation of binary tree (C language version)

Kubernetes family container housekeeper pod online Q & A?

Summary of interview project technology stack
![[shutter] banner carousel component (shutter_wiper plug-in | swiper component)](/img/a6/5c97ef3f34702b83ebf0511501d757.gif)
[shutter] banner carousel component (shutter_wiper plug-in | swiper component)
随机推荐
Kubernetes family container housekeeper pod online Q & A?
Random Shuffle attention
Hcip137-147 title + analysis
The process of connecting MySQL with docker
Unity3d human skin real time rendering real simulated human skin real time rendering "suggestions collection"
Le processus de connexion mysql avec docker
Random shuffle note
用docker 连接mysql的过程
How to select the minimum and maximum values of columns in the data table- How to select min and max values of a column in a datatable?
Source code analysis | layout file loading process
Can netstat still play like this?
[translation] modern application load balancing with centralized control plane
[principles of multithreading and high concurrency: 1_cpu multi-level cache model]
[fluent] listview list (map method description of list set | vertical list | horizontal list | code example)
Deep learning: multi-layer perceptron and XOR problem (pytoch Implementation)
How to limit the size of the dictionary- How to limit the size of a dictionary?
yii2 中andWhere多个or查询 orm条件
Practice of traffic recording and playback in vivo
[shutter] banner carousel component (shutter_wiper plug-in | swiper component)
I2C subsystem (IV): I2C debug