jquery 复选框操作-prop()的使用
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
<meta charset="utf-8" />
<script src="jquery-3.3.1.js"></script>
<script>
$(function () {
$('#btnSelectAll').click(function () {
$('div :checkbox').prop('checked', true);
});
$('#btnNotSelectAll').click(function () {
$('div :checkbox').prop('checked', false);
});
$('#btnFX').click(function () {
$('div :checkbox').each(function (index, ele) {
$(ele).prop('checked', !$(ele).prop('checked'));
});
});
})
</script>
</head>
<body>
<input type="button" name="name" value="全选" id="btnSelectAll" />
<input type="button" name="name" value="全不选" id="btnNotSelectAll" />
<input type="button" name="name" value="反选" id="btnFX" />
<div>
<input type="checkbox" name="name" value="1" />1
<input type="checkbox" name="name" value="2" />2
<input type="checkbox" name="name" value="3" />3
<input type="checkbox" name="name" value="4" />4
<input type="checkbox" name="name" value="4" />5
</div>
</body>
</html>
jquery 复选框操作-prop()的使用的更多相关文章
- jQuery——复选框操作
学习jQuer对表单.表格操作的过程中,按照书上的例子发现一个问题: <!DOCTYPE html> <html> <head> <title>复选框应 ...
- jquery复选框操作
$('input[type="checkbox"]').change(function(e) { var checked = $(this).prop("checked& ...
- jquery复选框 选中事件 及其判断是否被选中
jquery复选框 选中事件 及其判断是否被选中 (2014-07-25 14:03:54) 转载▼ 标签: jquery复选框选中事件 分类: extjs jquery 今天做了 显示和不显示密 ...
- python之tkinter使用-复选框操作
# tkinter复选框操作 import tkinter as tk root = tk.Tk() root.title('问卷调查') root.geometry('220x80') # 设置窗口 ...
- C#:复选框操作类
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.W ...
- Jquery复选框
Jquery复选框 1.checkbox list选择 代码: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//E ...
- JS及Dom练习 | 模态对话框及复选框操作
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- Thymeleaf+layui+jquery复选框回显
一.Thymeleaf+layui+jquery复选框回显 基于Thymeleaf模板下的layui+jquery复选框回显,主要是jquery.大致意思是:把数组转成JSON传到前台,再在前台转回数 ...
- 【jQuery】对于复选框操作的attr与prop
这个是在jQuery1.6版本号之后出现的鬼东西.受影响的主要有下拉列表select与复选框checkbox.众所周知.在jQuery中能够用attr()取出节点的属性,然而对于checkbox却不是 ...
随机推荐
- 【76.57%】【codeforces 721A】One-dimensional Japanese Crossword
time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard ou ...
- 【35.00%】【z13】&&【b093】最优贸易
[题解] 这题就是要在n个点里面选一个花费最小的点.然后找一个花费最大的点.两者之差为最大值. 但是最大值的点要在最小值的点之后出现.且走到后者之后要能够到达N号节点.为了处理掉环.先用tarjan进 ...
- js进阶正则表达式14验证邮编(input的pattern属性)(正则表达式加起^始$)
js进阶正则表达式14验证邮编(input的pattern属性)(正则表达式加起^始$) 一.总结 1.input的pattern属性:里面可以直接放正则表达式,<input type=&quo ...
- Opencv Surf算子特征提取与最优匹配
Opencv中Surf算子提取特征,生成特征描述子,匹配特征的流程跟Sift是完全一致的,这里主要介绍一下整个过程中需要使用到的主要的几个Opencv方法. 1. 特征提取 特征提取使用SurfFea ...
- 【codeforces 758A】Holiday Of Equality
time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard ou ...
- [Django] Creating an app, models and database
To add a new app, first cd to the project. Then run: python manage.py startapp scrumboard After that ...
- 【a501】算24点
Time Limit: 1 second Memory Limit: 32 MB [问题描述] 几十年前全世界就浒一种数字游戏,至今仍有人乐此不疲.在中国我们把这种游戏称为"算24点&quo ...
- ios 即时通讯开源IM,LeanCloud、融云、环信
环信官网链接: http://easemob.com/docs/ios/
- 【9302】&&【a301】兔子繁殖
Time Limit: 10 second Memory Limit: 2 MB 问题描述 有一种兔子,出生后一个月就可以长大,然后再过一个月一对长大的兔子就可以生育一对小兔子且以后每个月都能生育一对 ...
- 【records】10.9-10.16
.