全选,鼠标坐标,关闭窗口!

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style>
table{ border-collapse:collapse;width:100%; height:100px; border:2px solid; border-color:#FF0033}
table td{ border-color:#FF0033 ; border:2px solid;}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>

<script>

function setCheck(flag)

 if(flag)
 {
  document.getElementById("checked_all").innerHTML="不全选"; 
 }
 else
 {
  document.getElementById("checked_all").innerHTML="全选";
 } 
 var elementall=document.forms[0].elements;
 for(var i=0;i<elementall.length;i++)
 {
  if(elementall[i].type=="checkbox")//&&elementall[i].id!="c_all"
  {
    elementall[i].checked=flag;
  }
 } 
}
function NewOpenWindow(url)
{
 window.open(url);
}
function DirectCloseWindow()
{
 window.opener=null;
 window.open('','_self');
 window.close();
}
function Checks()
{
 alert("相关内容未完善!无法提交表单...");
 return false;
}
function GetXY()
{
 document.getElementById("positions").innerHTML="X:"+event.x+",Y:"+event.y;
}
</script>
</head>

<body>
<form>
<table οnmοusemοve="GetXY()">
<tr >
<td ><input type="checkbox" name="c1" />游戏&nbsp;&nbsp;<input type="checkbox" name="c2" />音乐&nbsp;&nbsp;<input type="checkbox" name="c3" />电影&nbsp;&nbsp;<input type="checkbox" name="c4" />逛街&nbsp;&nbsp;<input type="checkbox" name="c5" />睡觉&nbsp;&nbsp;</td>
<td ><input type="checkbox" id="c_all"  οnclick="setCheck(checked)"/><span id="checked_all">全选</span></td>
</tr>
<td><input type="button"value="在新窗口中打开" οnclick="NewOpenWindow('http://www.baidu.com')" />&nbsp;<input type="button" value="提示关闭窗口" οnclick="window.close()" />&nbsp;<input type="button" value="直接关闭窗口" οnclick="DirectCloseWindow()"/></td>
<td width="300" ><span id="positions"></span>&nbsp;&nbsp;&nbsp;</td>
<tr>
</tr>
</table>
<input name="submit" type="submit" value="提交表单" οnclick="return Checks()" style=" text-align:center" />
</form>

</body>
</html>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值