<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>host of cloned 'a' element</title> | |
</head> | |
<body> | |
<script> | |
var a = document.createElement('a'); | |
a.href = ''; | |
a = a.cloneNode(false); | |
document.write('<p>a.host: ' + a.host + '<\/p>'); | |
document.write('<p>location.host: ' + location.host + '<\/p>'); | |
</script> | |
</body> | |
</html> |
This comment has been minimized.
This comment has been minimized.
This behavior of IE was referred to in http://d.hatena.ne.jp/monjudoh/20110207/1297071182 (written in Japanese). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This comment has been minimized.
Open console and run the following code in any page.
We expect
a.host
to be'bl.ocks.org'
but in IE it becomes a host of parent document.