<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="Generator" content="">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
<title>checkbox全选/反选</title>
<script src="jquery.js"> </script>
<script type="text/javascript">
$(document).ready(function(){
$("#check").change(function(){
//全选/反选所有name="goods"的checkbox
$("input[name='goods']").prop("checked",this.checked);
//全选/反选所有checkbox
//$("input[type='checkbox']").prop("checked",this.checked);
});
});
</script>
</head>
<body>
<center>
全选/反选<input type="checkbox" id="check"/><br/>
<input type="checkbox" name="goods"/><br/>
<input type="checkbox" name="goods"/><br/>
<input type="checkbox" name="goods"/><br/>
<input type="checkbox" name="goods"/><br/>
<input type="checkbox" name="goods"/><br/>
<input type="checkbox" name="goods"/><br/>
<input type="checkbox" name="goods"/><br/>
<input type="checkbox" name="goods"/><br/>
<input type="checkbox" name="goods"/><br/>
<input type="checkbox" name="goods"/><br/>
<input type="checkbox" name="goods"/><br/>
</center>
</body>
</html>

jQuery全选/反选checkbox的更多相关文章

  1. jquery、js全选反选checkbox

    操作checkbox,全选反选 //全选 function checkAll() { $('input[name="TheID"]').attr("checked&quo ...

  2. 关于JQuery全选/反选第二次失效的问题

    最近在项目中,遇到一个问题,测试全选/反选功能时,第一次对母框进行选中/非选中时,能同步子框的全选/反选状态,之后再点击母框,子框就没反应了.原代码大致结构关键如下: function selectA ...

  3. jQuery全选反选插件

    (function($){ $.fn.check = function(options){ var options = $.extend({ element : "input[name='n ...

  4. jQuery全选反选实例

    1. $('#tb:checkbox').each(function(){ 每次都会执行 全选-取消操作,注意$('#tb :checkbox').prop('checked',true); tb后面 ...

  5. JQuery 全选 反选 获取Table 中指定td的元素值

    //全选 function initTableCheckbox() { var $thr = $('table thead tr'); var $checkAllTh = $('<th>& ...

  6. jquery全选 反选

    //全选 反选 $('#chkAll').on('click',function(){ $('input.chkbox').prop('checked',$(this).prop('checked') ...

  7. 关于jquery全选反选 批量删除的一点心得

    废话不多说直接上代码: 下面是jsp页面的html代码: <table id="contentTable" class=""> <thead& ...

  8. jquery全选反选

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  9. jQuery 全选 反选 单击行改变背景色

    我先把CSS样式放出来,其实这个可以直接忽略 ;;font-size:12px;font-family:微软雅黑;} .datagrid{width:100%;} .datagird tr th{ba ...

随机推荐

  1. Implement strStr()

    Implement strStr(). Returns the index of the first occurrence of needle in haystack, or -1 if needle ...

  2. [LintCode] Mini Twitter 迷你推特

    Implement a simple twitter. Support the following method: postTweet(user_id, tweet_text). Post a twe ...

  3. Js分页插件,支持页面跳转

    这里先给出API: 你只需要提供一个对象涉及以下几项属性,你来设置属性值,通过jq对象链式调用page()以参数形式来加载这个对象,按照参数要求会自动生成分页功能, 参数中pageEvent是可以让你 ...

  4. *HDU 1286,2824欧拉函数

    #include<iostream> #include<string> #include<cstdio> #include<cmath> #includ ...

  5. c#语句 类

    知识点: 1.string类 2.Math类 3.DateTime  获取时间 for穷举 1.羽毛球拍15元,球3元,水2元.现有200元,每种至少买一个,共有多少种可能.

  6. $.getJSON JSONP的新坑

    神坑1:返回的内容必须是正规的json数据.如 { "firstName": "Bill", "lastName": "Gates ...

  7. 用户、组或角色 '' 在当前数据库中已存在。 (Microsoft SQL Server,错误: 15023)

    SQLServer2008用户组或角色'*****'在当前数据库中已存在问题的解决办法 在迁移数据库的过程中SQLServer SDE的问题 为一个数据库添加一个用户时,提示以下信息:用户.组或角色 ...

  8. php中防盗链使用.htaccess

    下面开始讲解:比如你的图片都在img目录下,那就在该目录下放一个名为 .htaccess 的文件,内容如下: php代码: 以下为引用的内容:RewriteEngine onRewriteCond % ...

  9. PHP读文件的一个乱码问题

    D:/3.txt是utf-8文件 $f1 = fopen('D:/3.txt','r');$str = fread($f1,10000);fclose($f1);echo substr($str,1, ...

  10. Go-Agent原理分析及FQ介绍

    作为一个程序员,相信大家是极度依赖google/stackoverflow/github的,可是国内有强大的GFW存在,以至于编程少了很多乐趣. 最近闹GFW狂潮,很多Chrome插件被封,连Shad ...