页面中存在标签 name=aa 同时存在js函数aa

来源:互联网 发布:vps香港主机 知乎 编辑:程序博客网 时间:2024/05/10 16:50

<?xml version="1.0" encoding="UTF-8" ?>
<%@ include file="/page/common/taglib.jsp" %>
<!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>Insert title here</title>
<script type="text/javascript">
  
   function aa(){
        alert('aa');
   }
 
</script>
</head>
<body>
<p>asdf</p>
<p>hehe</p>
<p>didi</p>
<p>enen</p>
<P>upper</P>
<P>yiya</P>
<img src="/kimages/login3.jpg" ALt="tupitjyjyan------------" name="aa">
<input checked/>
<INPUT CHECKED/>
You & me -You &amp; me
<BUTTON onclick="aa();">ad</BUTTON>
<button onclick="aa();">aa</button>

因为<img name="aa"/>存在名称为aa的属性,同时页面中也存在aa的函数aa();

在浏览器中既然不能调用aa()函数,报错:对象不支持此属性或方法