`
tanglong8848
  • 浏览: 67302 次
  • 性别: Icon_minigender_1
  • 来自: 北京
文章分类
社区版块
存档分类
最新评论

奇怪的JS问题

阅读更多

<!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=gb2312" />
<title>test page</title>

<script type="text/javascript">
function tested(){
document.getElementById("testdisplay").style.display="none";
alert("执行了tested()!");
}
</script>

<script type="text/javascript">
function test(){
document.getElementById("testdisplay").style.display="none";
alert("执行了test()!");
}
</script>
</head>
<body>
<form name="logform" id="logform" action="http://www.2345.com/" method="post" >

方法一样方法名不同,但出现两种结果;<br>
<input type="text" id="testdisplay" name="test" text="input"/>
<input type="button" value="这个可以隐" onclick="tested()" />
<input type="button" value="这个不可以隐" onclick="test()" />
说明一个问题,与方法名有一定的影响;谁能说明为什么呀?
</form>
</body>
</html>

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics