惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
H
Hacker News: Front Page
P
Palo Alto Networks Blog
T
ThreatConnect
Apple Machine Learning Research
Apple Machine Learning Research
博客园_首页
T
True Tiger Recordings
P
Privacy & Cybersecurity Law Blog
B
Blog
IT之家
IT之家
Last Week in AI
Last Week in AI
F
Full Disclosure
Hacker News: Ask HN
Hacker News: Ask HN
C
Comments on: Blog
Microsoft Azure Blog
Microsoft Azure Blog
C
Cybersecurity and Infrastructure Security Agency CISA
Microsoft Security Blog
Microsoft Security Blog
博客园 - 【当耐特】
N
News and Events Feed by Topic
NISL@THU
NISL@THU
腾讯CDC
雷峰网
雷峰网
Security Latest
Security Latest
李成银的技术随笔
M
Microsoft Research Blog - Microsoft Research
L
LangChain Blog
L
Lohrmann on Cybersecurity
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
C
Check Point Blog
Y
Y Combinator Blog
Recent Announcements
Recent Announcements
博客园 - Franky
N
News | PayPal Newsroom
V
V2EX
A
About on SuperTechFans
The Register - Security
The Register - Security
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Google Online Security Blog
Google Online Security Blog
MyScale Blog
MyScale Blog
Cisco Talos Blog
Cisco Talos Blog
Vercel News
Vercel News
WordPress大学
WordPress大学
C
Cyber Attacks, Cyber Crime and Cyber Security
The Hacker News
The Hacker News
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
爱范儿
爱范儿
A
Arctic Wolf
L
LINUX DO - 最新话题
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More

博客园 - Lucy.Net

http://www.cisco.com/en/US/docs/wireless/access_point/12.3_8_JA/configuration/guide/s38web.html - Lucy.Net ASP.NET网页的安全性设计 水晶报表打印大小的问题 - Lucy.Net Unix命令大全 求救:vs2003新建asp.net项目时报错:服务器返回的信息无效或不可识别 Windows常用知识 Solarise的一些Q AND A (转贴) 将DataGrid数据写入Excel文件 用.net实现远程获取其他网站页面内容!(核心代码分析) Transact SQL 常用语句以及函数 汇文软件学习笔记 ASP.NET组件设计 Microsoft MSDN Crystalreportviewer 水晶报表 Encode - Lucy.Net 爱情是什么 33招Google技巧玩 网络邻居问题 Dos大全
vs下的checkbox全选 - Lucy.Net - 博客园
Lucy.Net · 2007-11-07 · via 博客园 - Lucy.Net

webform1.aspx

<%@ Page Language="vb" AutoEventWireup="false" Codebehind="WebForm1.aspx.vb" Inherits="JavascriptStudy.WebForm1"%> 

<%@ Page Language="vb" AutoEventWireup="false" Codebehind="WebForm1.aspx.vb" Inherits="JavascriptStudy.WebForm1"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
 <HEAD>
  <title>WebForm1</title>
  <meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
  <meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE">
  <meta content="JavaScript" name="vs_defaultClientScript">
  <meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
  <script language="javascript" type="text/javascript" src="./01.js"></script>
 </HEAD>
 <body MS_POSITIONING="GridLayout">
  <form id="Form1" method="post" runat="server">
   <asp:checkbox id="CheckBox0" style="Z-INDEX: 101; LEFT: 16px; POSITION: absolute; TOP: 24px" runat="server"
    p="x" ToolTip="x"></asp:checkbox><asp:checkbox id="CheckBox1" style="Z-INDEX: 102; LEFT: 16px; POSITION: absolute; TOP: 48px" runat="server"
    p="x" ToolTip="x"></asp:checkbox><INPUT id="Button1" style="Z-INDEX: 103; LEFT: 16px; POSITION: absolute; TOP: 96px" type="button"
    value="SelectAll"><INPUT style="Z-INDEX: 104; LEFT: 96px; POSITION: absolute; TOP: 96px" type="button" value="ClearAll"
    id="Button2"></form>
 </body>
</HTML>

01.js

window.onload=initAll;


function checkAll()
{
 var el=document.getElementsByTagName("span");
 for (var i=0;i<el.length;i++)
 {
  if (el[i].p=="x")
  {
   if (el[i].getElementsByTagName("input")[0].getAttribute("type")=="checkbox")
   {
    el[i].getElementsByTagName("input")[0].setAttribute("checked",true);
   }
  }
 }
}
function clearAll()
{
 var el=document.getElementsByTagName("span");
 for (var i=0;i<el.length;i++)
 {
  if (el[i].p=="x")
  {
   if (el[i].getElementsByTagName("input")[0].getAttribute("type")=="checkbox")
   {
    el[i].getElementsByTagName("input")[0].setAttribute("checked",false);
   }
  }
 }
}

function initAll()
{
 document.getElementById("Button1").onclick=checkAll;
 document.getElementById("Button2").onclick=clearAll;
}

发表于 2007-11-07 09:09  Lucy.Net  阅读(338)  评论()    收藏  举报