<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head><body>
<input type="radio" name="power" onclick="show()" checked/>ON
<input type="radio" name="power" onclick="hidden()" />OFF
<input type="button"name="power" value="关闭" onclick="hidden()"/>
<input type="button"name="power" value="打开" onclick="show()"/><table align="center" border="1" id="iso">
<tr> <td> apple</td>
<td> banana</td>
</tr>
<tr> <td> pear</td>
<td> mango</td>
</tr>
</table>
<script>
function show() {
document.getElementById("iso").style.display="block";
}
function hidden(){
document.getElementById("iso").style.display="none";
}
</script>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head><body>
<input type="radio" name="power" onclick="show()" checked/>ON
<input type="radio" name="power" onclick="hidden()" />OFF
<input type="button"name="power" value="关闭" onclick="hidden()"/>
<input type="button"name="power" value="打开" onclick="show()"/><table align="center" border="1" id="iso">
<tr> <td> apple</td>
<td> banana</td>
</tr>
<tr> <td> pear</td>
<td> mango</td>
</tr>
</table>
<script>
function show() {
document.getElementById("iso").style.display="block";
}
function hidden(){
document.getElementById("iso").style.display="none";
}
</script>
</body>
</html>
<html>
<head>
<meta charset="gb2312" />
<title></title>
<style>
</style>
</head>
<body>
<div id="t" onclick="hidden();">123</div>
<script>
function hidden(){
alert(123)
}
</script>
</body>
</html>
ff下提示:
hidden is not a function。而用 document.getElementById('t').onclick = hidden; 则没问题。表示这个问题很诡异。