<html>
<title>这是一段测试代码</title>
<script type="text/javascript">function test(obj){
 if (document.all){ //IE
    
  obj.innerHTML+="<br/>obj:"+obj.getAttribute("id")+"<br/>obj\.firstChild:"+obj.firstChild.getAttribute("id")+"<br/>event.toElement:"+event.toElement.getAttribute("id");
  obj.innerHTML+="<br/>obj.contains(obj.firstChild):"+obj.contains(obj.firstChild)+"<br/>obj.contains(event.toElement):"+obj.contains(event.toElement)+"<br/>"; 
}}
</script>
<body>
<div id="outer" style="width:400px;height:300px;background:#ccc;"  onmouseover="test(this);"><div id="inner" style="width:300px;height:200px;background:#333;"></div></div>
</body></html>
测试环境:IE9
问题一:当鼠标移动到$("inner")上时,obj.contains(obj.firstChild)与obj.contains(event.toElement)执行结果为何不同?(此时通过元素id可知“obj.firstChild”与“event.toElement”为同一节点,obj是不变的)
问题二:当鼠标移动到$("inner")上时,test函数怎么执行了不止一次?
问题三:在<html>前加上<!DOCTYPE HTML>后调试结果为:对象不支持getAttribute属性或方法;