当前位置:网站首页>复选框的使用:全选,全不选,选一部分
复选框的使用:全选,全不选,选一部分
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为标记用来区分是全选复选框,某个复选框
边栏推荐
- HW initial preparation
- Informatics Olympiad one general question bank 1006 a+b questions
- JS finds all the parent nodes or child nodes under a node according to the tree structure
- 从C到Capable-----利用指针作为函数参数求字符串是否为回文字符
- Baidu map - surrounding search
- Your family must be very poor if you fight like this!
- 二维格式数组格式索引下标连续问题导致 返回json 格式问题
- Strategy application of Dameng database
- 【富瀚6630编码存录像,用rtsp服务器及时间戳同步实现vlc观看录像】
- 2022-2028 global splicing display industry research and trend analysis report
猜你喜欢
[flutter] example of asynchronous programming code between future and futurebuilder (futurebuilder constructor setting | handling flutter Chinese garbled | complete code example)
[translation] modern application load balancing with centralized control plane
The process of connecting MySQL with docker
The Linux server needs to install the agent software EPS (agent) database
Le processus de connexion mysql avec docker
Pytest (6) -fixture (Firmware)
[error record] the parameter 'can't have a value of' null 'because of its type, but the im
基于can总线的A2L文件解析(2)
Today, it's time to copy the bottom!
从C到Capable-----利用指针作为函数参数求字符串是否为回文字符
随机推荐
How to limit the size of the dictionary- How to limit the size of a dictionary?
Process the dataset and use labelencoder to convert all IDs to start from 0
Opengauss database development and debugging tool guide
MATLAB小技巧(24)RBF,GRNN,PNN-神经网络
内存泄漏工具VLD安装及使用
Xiaodi notes
ASP. Net core 6 framework unveiling example demonstration [02]: application development based on routing, MVC and grpc
The core idea of performance optimization, dry goods sharing
xiaodi-笔记
【Flutter】shared_ Preferences local storage (introduction | install the shared_preferences plug-in | use the shared_preferences process)
Deep learning: multi-layer perceptron and XOR problem (pytoch Implementation)
The Linux server needs to install the agent software EPS (agent) database
Reset or clear NET MemoryStream - Reset or Clear . NET MemoryStream
后管中编辑与预览获取表单的值写法
Summary of interview project technology stack
左值右指解释的比较好的
Change cell color in Excel using C - cell color changing in Excel using C
[C language] MD5 encryption for account password
TCP 三次握手和四次挥手机制,TCP为什么要三次握手和四次挥手,TCP 连接建立失败处理机制
tensor中的append应该如何实现