---
title: "JQUERY复选框CHECKBOX全选,取消全选"
author: "flowercat"
date: "2010-05-11T14:37:49Z"
tags: []
categories: ["Web前端"]
slug: "jquery-checkbox"
draft: false
lastmod: "2010-05-11T14:37:49Z"
id: 663906
url: "https://flowercat.iteye.com/blog/663906"
---

$("#checkall").click(  
    function(){  
        if(this.checked){  
            $("input\[name='pid']").each(function(){this.checked=true;});  
        }else{  
            $("input\[name='pid']").each(function(){this.checked=false;});  
        }  
    }  
);