JavaScript 复选框的反选
Code:
<!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>
<title>无标题页</title>
<mce:script language="javascript" type="text/jscript"><!--
function CheckOthers(ck)
{
for(var i=0;i<ck.elements.length;i++)
{
if(ck.elements[i].type=="checkbox")
{
if(ck.elements[i].checked==false)
{
ck.elements[i].checked=true;
}
else
{
ck.elements[i].checked=false;
}
}
}
}
// --></mce:script>
</head>
<body>
<form id="fm">
<table style="width: 180px" border="2" id="tb">
<tr>
<td colspan="2">
<input id="Checkbox1" type="checkbox" name="ck"/><label for="Checkbox1">北京奥运会</label></td>
</tr>
<tr>
<td colspan="2">
<input id="Checkbox2" type="checkbox" name="ck"/><label for="Checkbox2">伦敦奥运会</label></td>
</tr>
<tr>
<td colspan="2">
<input id="Checkbox3" type="checkbox" name="ck"/><label for="Checkbox3">里约热内卢奥运会</label></td>
</tr>
<tr>
<td colspan="2">
<input id="Checkbox4" type="checkbox" name="ck"/><label for="Checkbox4">澳大利亚奥运会</label></td>
</tr>
<tr>
<td colspan="2">
<input id="Checkbox5" type="checkbox" name="ck"/><label for="Checkbox5">南非世界杯</label></td>
</tr
相关文档:
今天了解了一点javascript的基础,记下来供后续学习翻阅:
数据类型的判断:typeof(var param) 判断变得数据类型
浏览器以及操作系统的判别变量 navigator.userAgent navigator.platform
var sUserAgent = navigator.userAgent;
//检测Opera、KHTML
var isOpera = sUserAgent.indexOf(" ......
尽管 JavaScript 历史上使用冗长而令人生厌的代码块来标的特定浏览器的时期已经结束了,但是偶尔使用一些简单的代码块和对象检测来确保一些代码在用户机器上正常工作依然是必要的。
这篇文章中,我会略述一下 Internet Explorer 和 Firefox 在 JavaScript 语法上不同的 7 个方面。
1. CSS “float” 属性
获取 ......
<!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>
<title>javas
cript 操作日期 测试</title>
<meta http-equiv= ......
1.asp.net呼叫js
Response.Write("<script language=javascript>");
......