当前位置:网站首页>Use JQ to realize the reverse selection of all and no selection at all - Feng Hao's blog
Use JQ to realize the reverse selection of all and no selection at all - Feng Hao's blog
2022-07-06 16:39:00 【Feng Hao (grow up)】
Ideas :
First call jq file
When we click Select all, we let them all be true
When clicking none of them, we let them all be false
When you click invert Use echo Loop traversal checked Use ! Take the opposite ;
html part
<input type="checkbox">
<input type="checkbox">
<button > Future generations </button>
<button > Not all </button>
<button'> Reverse election </button>
js part
// Click Select all
$('button:first').click(function(){
$(':checkbox').prop('checked',true);
})
// Click none eq: Get inverse selection button
$('button:eq(1)').click(function(){
$(':checkbox').prop('checked',false);
})
// Click invert
$('button:last').click(function(){
$(':checkbox').each(function(index,item){
item.checked = !item.checked;
})
})
边栏推荐
- Useeffect, triggered when function components are mounted and unloaded
- MP4格式详解
- Spark's RDD (elastic distributed data set) returns a large result set
- The concept of spark independent cluster worker and executor
- 第7章 __consumer_offsets topic
- China double brightening film (dbef) market trend report, technical dynamic innovation and market forecast
- Anaconda下安装Jupyter notebook
- 顺丰科技智慧物流校园技术挑战赛(无t4)
- 视频压缩编码和音频压缩编码基本原理
- Acwing: Game 58 of the week
猜你喜欢
提交Spark应用的若干问题记录(sparklauncher with cluster deploy mode)
字节跳动新程序员成长秘诀:那些闪闪发光的宝藏mentor们
Advancedinstaller安装包自定义操作打开文件
QT implementation fillet window
Solve the problem of intel12 generation core CPU [small core full, large core onlookers] (win11)
使用jq实现全选 反选 和全不选-冯浩的博客
Chapter 5 namenode and secondarynamenode
解决Intel12代酷睿CPU单线程调度问题(二)
Chapter 1 overview of MapReduce
Codeforces round 797 (Div. 3) no f
随机推荐
去掉input聚焦时的边框
Codeforces Round #801 (Div. 2)A~C
Codeforces Round #802(Div. 2)A~D
Story of [Kun Jintong]: talk about Chinese character coding and common character sets
Codeforces round 797 (Div. 3) no f
js封装数组反转的方法--冯浩的博客
(POJ - 3186) treatments for the cows (interval DP)
第三章 MapReduce框架原理
(lightoj - 1236) pairs forming LCM (prime unique decomposition theorem)
Summary of FTP function implemented by qnetworkaccessmanager
解决Intel12代酷睿CPU单线程只给小核运行的问题
<li>圆点样式 list-style-type
Codeforces Round #800 (Div. 2)AC
解决Intel12代酷睿CPU【小核载满,大核围观】的问题(WIN11)
Research Report on market supply and demand and strategy of China's four seasons tent industry
Date plus 1 day
Problem - 1646C. Factorials and Powers of Two - Codeforces
input 只能输入数字,限定输入
浏览器打印边距,默认/无边距,占满1页A4
Research Report on market supply and demand and strategy of Chinese table lamp industry