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")) ...
随机推荐
- purge mysql自带命令清除binlog
#!/bin/bash DATAUSER=root DATAPASS=shiyiwen DAY=$1 if [ ! $# == 1 ];then echo -e "\033[32m USAG ...
- centos6 搭建ELK
mark一下时间:2016年2月19日10:17:09 记录使用 Logstash: Logstash服务的组件,用于处理传入的日志. Elasticsearch: 存储所有日志 Kibana 4: ...
- Ceph与OpenStack的Glance相结合
http://docs.ceph.com/docs/master/rbd/rbd-openstack/?highlight=nova#kilo 在Ceoh的admin-node上进行如下操作: 1. ...
- scp使用加密算法报错unknown cipher type
为了提高scp的传输速度指定了scp的加密算法为arcfour $ scp -c arcfour localFile userName@remoteIP:remoteFile 得到报错unknown ...
- A trip through the Graphics Pipeline 2011_12 Tessellation
Welcome back! This time, we’ll look into what is perhaps the “poster boy” feature introduced with th ...
- Apache Spark源码走读之23 -- Spark MLLib中拟牛顿法L-BFGS的源码实现
欢迎转载,转载请注明出处,徽沪一郎. 概要 本文就拟牛顿法L-BFGS的由来做一个简要的回顾,然后就其在spark mllib中的实现进行源码走读. 拟牛顿法 数学原理 代码实现 L-BFGS算法中使 ...
- Java 实现MapReduce函数
明白了MapReduce程序的工作原理之后,下一步就是写代码来实现它.我们需要三样东西:一个map函数.一个reduce函数和一些用来运行作业的代码.map函数由Mapper类来表示,后者声明一个ma ...
- ios之json,xml解析
JSON解析步骤: 1.获取json文件路径 NSString*path = [[NSBundle mainBundle] pathForResource:@"Teacher"of ...
- PowerDesigner连接mysql逆向生成pdm
常用的建模工具有:PowerDesigner和ERWin,后者已快被淘汰,但前者依然活跃.相信大家都遇到过项目组已经运营很很久,但是竟然连一个ER图都没有,今天就讲解一下PowerDesigner连接 ...
- DNS视图以及日志压力测试
1 访问控制列表 配置在/etc/named.conf文件的最顶端 acl innct { 192.168.1.0/24; 127.0.0.0/8; }; ...