<!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" />游戏 <input type="checkbox" name="c2" />音乐 <input type="checkbox" name="c3" />电影 <input type="checkbox" name="c4" />逛街 <input type="checkbox" name="c5" />睡觉 </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')" /> <input type="button" value="提示关闭窗口" οnclick="window.close()" /> <input type="button" value="直接关闭窗口" οnclick="DirectCloseWindow()"/></td>
<td width="300" ><span id="positions"></span> </td>
<tr>
</tr>
</table>
<input name="submit" type="submit" value="提交表单" οnclick="return Checks()" style=" text-align:center" />
</form>
</body>
</html>