python: jquery实现全选 反选 取消
引入这个jquery-1.12.4.js
jquery实现全选 反选 取消
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Title</title>
</head>
<body>
<input type="button" value="quanxuan" onclick="全选()"/>
<input type="button" value="fanxuan" onclick="反选()"/>
<input type="button" value="quxiao" onclick="取消()"/> <table>
<thead>
<tr>
<th>选择</th>
<th>ip</th>
<th>端口</th>
</tr> </thead>
<tbody class="tb">
<tr>
<td><input type="checkbox"/></td>
<td>1.1.1.</td>
<td>88</td> </tr>
<tr>
<td><input type="checkbox"/></td>
<td>1.1.1.</td>
<td>88</td> </tr>
<tr>
<td><input type="checkbox"/></td>
<td>1.1.1.</td>
<td>88</td> </tr>
</tbody>
</table>
<script src="jquery-1.12.4.js"></script>
<!--第一种方法-->
<script>
function quanxuan() {
$('input[type="checkbox"]').prop('checked', true)
}
function quxiao() {
$('input[type="checkbox"]').prop('checked', false)
}
// function fanxuan() {
// $('input[type="checkbox"]').each(function () {
// if(this.checked){
// this.checked=false
// }else {
// this.checked=true
// }
//
// })
// 用jquery实现反选
// checkbox radio 选择一定要用prop
//$().prop('checked') 获取值
//$().prop('checked',true) 设置值
function fanxuan() {
$('input[type="checkbox"]').each(function () {
if ($(this).prop("checked")) {
$(this).prop("checked", false)
} else {
$(this).prop("checked", true)
} }) } </script> </body>
</html>
python: jquery实现全选 反选 取消的更多相关文章
- jquery实现全选 反选 取消
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- jquery实现全选,取消,反选的功能&实现左侧菜单
1.全选,取消,反选的例子 <!DOCTYPE html> <html lang="en"> <head> <meta charset=& ...
- jquery 书写全选反选功能
书写一个后台管理中用到的全选反选功能.代码如下 <!DOCTYPE html> <html lang="en"> <head> <meta ...
- jQuery --checkbox全选和取消全选简洁高效的解决办法
最近在公司做了一个小项目,其中有一个全选和取消全选的这么一个模块,搞了半天找不到一种最佳的解决方案!后来通过各种努力找到了一种简洁高效的解决办法,这里想和大家分享一下.有问题的话,还望各路大神指导一二 ...
- jquery实现全选/反选功能
<!DOCTYPE html><html><head> <meta http-equiv="Content-Type" content=& ...
- jQuery实现全选/反选和批量删除
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncod ...
- jquery购物车全选,取消全选,计算总金额
这是html代码 <div class="gwcxqbj"> <div class="gwcxd center"> <div cl ...
- jquery实现全选、取消反选、加JavaScript三元运算(三种法法实现反选)
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- jquery 实现全选反选
jquery代码 $(function () { $('#inputCheck').click(function () { if ($(this).attr("checked")) ...
随机推荐
- Java获取前天和后天的时间
import java.text.ParseException;import java.text.SimpleDateFormat;import java.util.Calendar;import j ...
- Oracle中建表和指定表空间
--建一个表create table HH2( tid number primary key ,--主键设定 tname varchar2(20) ); --删除表drop table HH; --表 ...
- BZOJ4448:[SCO2015]情报传递
题目大意:给你一棵树,有两种操作,一个是修改某个点的权值,另一个是询问两点之间的距离以及路径上小于某个值的数的个数. 询问两点之间距离直接lca即可,对于求个数的问题可以用主席树完成. #includ ...
- 四个查找命令find,locate,whereis,which的区别
find最强大,但是检索硬盘,比较慢: whereis只能查二进制文件.说明文档,源文件等: locate能查所有文件,但跟whereis一样都是查数据库里的内容,速度快,但有延时: which 只能 ...
- 【iCore3 双核心板_ uC/OS-III】例程十:消息队列
实验指导书及代码包下载: http://pan.baidu.com/s/1sleklm1 iCore3 购买链接: https://item.taobao.com/item.htm?id=524229 ...
- windows 精简/封装/部署
给一个精简过的Windows7安装net35,提示自己到『打开或关闭Windows功能』里打开,然而发现并没有,只有一个ie9的功能.搜索尝试各种办法,显然都不行.用dism部署功能的工具,挂载一个完 ...
- 树莓派文档翻译 - 使用 - GPIO: 树莓派A和B
https://www.raspberrypi.org/documentation/usage/gpio/README.md 2016/6/25 GPIO: 树莓派A和B ##介绍GPIO和在树莓派上 ...
- grep中正则匹配的使用
如要匹配Computer或computer两个单词,可做如下操作: [Cc]mputer “.”允许匹配ASCII集中任意字符,或为字母,或为数字. 使用\{\}匹配模式结果出现的次数 匹配字母A出现 ...
- CSS之border-radius
1.圆角设置 CSS3圆角只需设置一个属性:border-radius(含义是"边框半径").你为这个属性提供一个值,就能同时设置四个圆角的半径.所有合法的CSS度量值都可以使用: ...
- C# base64编码的文本与图片互转
/// <summary> /// base64编码的文本转为图片 /// </summary> /// <param name="txtFilePath&qu ...