---
title: "全选 反选 取消 js函数"
author: "wc_stone"
date: "2007-11-22T14:38:00Z"
tags: []
slug: "js"
draft: false
lastmod: "2007-11-22T14:38:00Z"
id: 142659
url: "https://wc-stone.iteye.com/blog/142659"
---

触发方法: 1.按钮(button) \[code] \[/code] 2.复选框(checkbox) \[code] 反选 \[/code] \[color=red]注：方法名和name名不可相同\[/color] 3.超链接(a) \[code] A.[全选](#) B.[取消](javascript:selectClear%28document.fromName%29) \[/code] 方法体： 1.全选 \[code] function SelectAll() { var obj=document.getElementById("userList"); for(var i=0 ;i