当前位置:网站首页>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;
})
})

边栏推荐
- Remove the border when input is focused
- Codeforces Round #797 (Div. 3)无F
- QT realizes window topping, topping state switching, and multi window topping priority relationship
- Bidirectional linked list - all operations
- 使用jq实现全选 反选 和全不选-冯浩的博客
- Codeforces - 1526C1&&C2 - Potions
- AcWing——第55场周赛
- (POJ - 3186) treatments for the cows (interval DP)
- 拉取分支失败,fatal: ‘origin/xxx‘ is not a commit and a branch ‘xxx‘ cannot be created from it
- 音视频开发面试题
猜你喜欢

第一章 MapReduce概述

Pull branch failed, fatal: 'origin/xxx' is not a commit and a branch 'xxx' cannot be created from it

软通乐学-js求字符串中字符串当中那个字符出现的次数多 -冯浩的博客

Codeforces Round #802(Div. 2)A~D

原生js实现全选和反选的功能 --冯浩的博客

(lightoj - 1369) answering queries (thinking)

Browser print margin, default / borderless, full 1 page A4

QT simulates mouse events and realizes clicking, double clicking, moving and dragging

第6章 Rebalance详解

Oneforall installation and use
随机推荐
Local visualization tools are connected to redis of Alibaba cloud CentOS server
Codeforces Round #801 (Div. 2)A~C
js时间函数大全 详细的讲解 -----阿浩博客
Spark的RDD(弹性分布式数据集)返回大结果集
China tetrabutyl urea (TBU) market trend report, technical dynamic innovation and market forecast
Codeforces Round #799 (Div. 4)A~H
【锟斤拷】的故事:谈谈汉字编码和常用字符集
Educational Codeforces Round 122 (Rated for Div. 2)
原生js实现全选和反选的功能 --冯浩的博客
SF smart logistics Campus Technology Challenge (no T4)
Research Report on market supply and demand and strategy of double drum magnetic separator industry in China
简单尝试DeepFaceLab(DeepFake)的新AMP模型
The concept of spark independent cluster worker and executor
提交Spark应用的若干问题记录(sparklauncher with cluster deploy mode)
300th weekly match - leetcode
第7章 __consumer_offsets topic
Bisphenol based CE Resin Industry Research Report - market status analysis and development prospect forecast
CMake Error: Could not create named generator Visual Studio 16 2019解决方法
Installation and configuration of MariaDB
Spark's RDD (elastic distributed data set) returns a large result set