1<html>
2<head>
3<meta charset="utf-8" content='\"text/html;' http-equiv='\"Content-Type\"'/>
4<title></title>
5<script language='\"JavaScript\"'>
6<!--
7first(\"selectp\",\"selectc\",\"theForm\",0,0);
8function showadv(){
9if (document.theForm.advshow.checked == true) {
10document.getElementById(\"adv\").style.display = \"\";
11document.getElementById(\"advance\").innerText=\"关闭高级用户设置选项\";
12}else{
13document.getElementById(\"adv\").style.display = \"none\";
14document.getElementById(\"advance\").innerText=\"显示高级用户设置选项\";
15}
16}
17//-->
18</script>
19</head>
20<body>
21<form action="reg.asp?action=save" method="post" name="theForm">
22<table align="center" border='\"2\"' cellpadding="3" cellspacing="1" id="adv" none\"="" style='\"DISPLAY:' width='\"500\"'>
23<tr>
24<td> </td>
25</tr>
26</table><table align="center" border="2" cellpadding="0" cellspacing="0" width='\"500\"'>
27<tr>
28<th align="left" width='\"45%\"'><input id="advcheck" name="advshow" onclick="showadv()" type="checkbox" value="1"/>
29<span id="advance">显示高级用户设置选项</span></th>
30<th align="center" width='\"55%\"'> </th>
31</tr>
32</table></form>
33</body>
34</html>
===================== 教程,教程
说明:
将下面的代码加到
1<head>与</head>
之间:
1<script language='\"JavaScript\"'>
2<!--
3first(\"selectp\",\"selectc\",\"theForm\",0,0);
4function showadv(){
5if (document.theForm.advshow.checked == true) {
6document.getElementById(\"adv\").style.display = \"\";
7document.getElementById(\"advance\").innerText=\"关闭高级用户设置选项\";
8}else{
9document.getElementById(\"adv\").style.display = \"none\";
10document.getElementById(\"advance\").innerText=\"显示高级用户设置选项\";
11}
12}
13//-->
14</script>
-------------------------
所用的表单及表格:
1<form action="reg.asp?action=save" method="post" name="theForm">
2<table align="center" border='\"2\"' cellpadding="3" cellspacing="1" id="adv" none\"="" style='\"DISPLAY:' width='\"500\"'>
3<tr>
4<td> </td>
5</tr>
6</table><table align="center" border="2" cellpadding="0" cellspacing="0" width='\"500\"'>
7<tr>
8<th align="left" width='\"45%\"'><input id="advcheck" name="advshow" onclick="showadv()" type="checkbox" value="1"/>
9<span id="advance">显示高级用户设置选项</span></th>
10<th align="center" width='\"55%\"'> </th>
11</tr>
12</table></form>
========================完~