如果下面标签在页面中
<a href="www.baidu.com/" id="dev_a"></a>
则,在IE下面结果是:
document.getElementById("dev_a").getAttribute("href")==file:///绝对路径/www.baidu.com/
document.getElementById("dev_a").getAttribute("href",1)==file:///绝对路径/www.baidu.com/
document.getElementById("dev_a").getAttribute("href",2)==www.baidu.com/
document.getElementById("dev_a").getAttribute("href",3)==www.baidu.com/
本文探讨了在Internet Explorer浏览器中使用JavaScript通过不同方式获取HTML页面中a标签的href属性值的现象。具体展示了四种不同的getAttribute方法调用,并解释了它们在IE中返回的不同结果。
785

被折叠的 条评论
为什么被折叠?



