<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<script type="text/javascript">
function mya(o){
//获取全选框
// var b=document.getElementById("call");
var a=document.getElementsByName("cc");
for(i=0;i<a.length;i++){
a[i].checked=o.checked;
}
}
// k为所传进来的对象,y 为所匹配的对象,
// s 和 e 为下面的 a 对象需要被截取的始终的下标值
function myb(k,y,s,e){
//将所有的复选框获取到
var a=document.getElementsByName("cc");
for(i=0;i<a.length;i++){
if(a[i].value.substring(s,e)==y){
a[i].checked=k.cheked;
}
}
}
</script>
</head>
<body>
<table border="1" align="center" width="550px">
<tr>
<td>全选<input type="checkbox" id="call" onclick="mya(this)"/></td>
<td>1月<input type="checkbox" name="cc" onclick="myb(this,'01',4,6)"/></td>
<td>2月<input type="checkbox" name="cc" onclick="myb(this,'02',4,6)"/></td>
<td>3月<input type="checkbox" name="cc" onclick="myb(this,'03',4,6)"/></td>
<td>4月<input type="checkbox" name="cc" onclick="myb(this,'04',4,6)"/></td>
<td>5月<input type="checkbox" name="cc" onclick="myb(this,'05',4,6)"/></td>
<td>6月<input type="checkbox" name="cc" onclick="myb(this,'06',4,6)"/></td>
</tr>
<tr>
<td>2008年<input type="checkbox" name="cc" onclick="myb(this,'2008',0,4)"/></td>
<td><input type="checkbox" name="cc" value="200801" /></td>
<td><input type="checkbox" name="cc" value="200802"/></td>
<td><input type="checkbox" name="cc" value="200803"/></td>
<td><input type="checkbox" name="cc" value="200804"/></td>
<td><input type="checkbox" name="cc" value="200805"/></td>
<td><input type="checkbox" name="cc" value="200806"/></td>
</tr>
<tr>
<td>2007年<input type="checkbox" name="cc" onclick="myb(this,'2007',0,4)"/></td>
<td><input type="checkbox" name="cc" value="200701"/></td>
<td><input type="checkbox" name="cc" value="200702"/></td>
<td><input type="checkbox" name="cc" value="200703"/></td>
<td><input type="checkbox" name="cc" value="200704"/></td>
<td><input type="checkbox" name="cc" value="200705"/></td>
<td><input type="checkbox" name="cc" value="200706"/></td>
</tr>
<tr>
<td>2006年<input type="checkbox" name="cc" onclick="myb(this,'2006',0,4)"/></td>
<td><input type="checkbox" name="cc" value="200601"/></td>
<td><input type="checkbox" name="cc" value="200602"/></td>
<td><input type="checkbox" name="cc" value="200603"/></td>
<td><input type="checkbox" name="cc" value="200604"/></td>
<td><input type="checkbox" name="cc" value="200605"/></td>
<td><input type="checkbox" name="cc" value="200606"/></td>
</tr>
<tr>
<td>2007年<input type="checkbox" name="cc" onclick="myb(this,'2005',0,4)"/></td>
<td><input type="checkbox" name="cc" value="200501"/></td>
<td><input type="checkbox" name="cc" value="200502"/></td>
<td><input type="checkbox" name="cc" value="200503"/></td>
<td><input type="checkbox" name="cc" value="200504"/></td>
<td><input type="checkbox" name="cc" value="200505"/></td>
<td><input type="checkbox" name="cc" value="200506"/></td>
</tr>
</table>
</body>
</html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<script type="text/javascript">
function mya(o){
//获取全选框
// var b=document.getElementById("call");
var a=document.getElementsByName("cc");
for(i=0;i<a.length;i++){
a[i].checked=o.checked;
}
}
// k为所传进来的对象,y 为所匹配的对象,
// s 和 e 为下面的 a 对象需要被截取的始终的下标值
function myb(k,y,s,e){
//将所有的复选框获取到
var a=document.getElementsByName("cc");
for(i=0;i<a.length;i++){
if(a[i].value.substring(s,e)==y){
a[i].checked=k.cheked;
}
}
}
</script>
</head>
<body>
<table border="1" align="center" width="550px">
<tr>
<td>全选<input type="checkbox" id="call" onclick="mya(this)"/></td>
<td>1月<input type="checkbox" name="cc" onclick="myb(this,'01',4,6)"/></td>
<td>2月<input type="checkbox" name="cc" onclick="myb(this,'02',4,6)"/></td>
<td>3月<input type="checkbox" name="cc" onclick="myb(this,'03',4,6)"/></td>
<td>4月<input type="checkbox" name="cc" onclick="myb(this,'04',4,6)"/></td>
<td>5月<input type="checkbox" name="cc" onclick="myb(this,'05',4,6)"/></td>
<td>6月<input type="checkbox" name="cc" onclick="myb(this,'06',4,6)"/></td>
</tr>
<tr>
<td>2008年<input type="checkbox" name="cc" onclick="myb(this,'2008',0,4)"/></td>
<td><input type="checkbox" name="cc" value="200801" /></td>
<td><input type="checkbox" name="cc" value="200802"/></td>
<td><input type="checkbox" name="cc" value="200803"/></td>
<td><input type="checkbox" name="cc" value="200804"/></td>
<td><input type="checkbox" name="cc" value="200805"/></td>
<td><input type="checkbox" name="cc" value="200806"/></td>
</tr>
<tr>
<td>2007年<input type="checkbox" name="cc" onclick="myb(this,'2007',0,4)"/></td>
<td><input type="checkbox" name="cc" value="200701"/></td>
<td><input type="checkbox" name="cc" value="200702"/></td>
<td><input type="checkbox" name="cc" value="200703"/></td>
<td><input type="checkbox" name="cc" value="200704"/></td>
<td><input type="checkbox" name="cc" value="200705"/></td>
<td><input type="checkbox" name="cc" value="200706"/></td>
</tr>
<tr>
<td>2006年<input type="checkbox" name="cc" onclick="myb(this,'2006',0,4)"/></td>
<td><input type="checkbox" name="cc" value="200601"/></td>
<td><input type="checkbox" name="cc" value="200602"/></td>
<td><input type="checkbox" name="cc" value="200603"/></td>
<td><input type="checkbox" name="cc" value="200604"/></td>
<td><input type="checkbox" name="cc" value="200605"/></td>
<td><input type="checkbox" name="cc" value="200606"/></td>
</tr>
<tr>
<td>2007年<input type="checkbox" name="cc" onclick="myb(this,'2005',0,4)"/></td>
<td><input type="checkbox" name="cc" value="200501"/></td>
<td><input type="checkbox" name="cc" value="200502"/></td>
<td><input type="checkbox" name="cc" value="200503"/></td>
<td><input type="checkbox" name="cc" value="200504"/></td>
<td><input type="checkbox" name="cc" value="200505"/></td>
<td><input type="checkbox" name="cc" value="200506"/></td>
</tr>
</table>
</body>
</html>
解决方案 »
- 用js在svg图上的上动态添加一张任意格式的图片
- EXTJS buttons按钮样式
- 推 荐 一 本 你 看 过 认 为 最 好 的 Javascript 的 书
- 请教各种大师,关于上下移动的问题
- 如何用javascript 获得客户端的jre的版本
- Jquery.Uploadify3.0 error -220 IO.Error
- 救命啊,ScriptX打印报错,项目后天马上要实施了!!!
- jsp页面从数据库读出的字段内容(包含回车键)赋给javascript变量时
- 我找不出錯誤??? 請大家幫忙,謝謝!
- window.open问题,为什么页面会找不到?
- 如何实现做一个滑动的返回顶部效果按钮
- js离开页面提示,但是点击确定不需要提示
拼写错了