1 |
wakaba |
1.1 |
<!DOCTYPE html> |
2 |
|
|
<html> |
3 |
|
|
<head> |
4 |
|
|
<title>createElement ().localName</title> |
5 |
|
|
</head> |
6 |
|
|
<body> |
7 |
|
|
<p id="result">FAIL (not executed)</p> |
8 |
|
|
<script type="text/javascript"> |
9 |
|
|
var result = document.getElementById ('result'); |
10 |
|
|
result.firstChild.data = 'FAIL'; |
11 |
|
|
var el = document.createElement ('elementName'); |
12 |
|
|
if (typeof (el.localName) == 'undefined') { |
13 |
|
|
result.firstChild.data = 'FAIL (undefined)'; |
14 |
|
|
} else if (el.localName == null) { |
15 |
|
|
result.firstChild.data = 'PASS (as per DOM3)'; |
16 |
|
|
} else if (el.localName == 'elementname') { |
17 |
|
|
result.firstChild.data = 'FAIL (lowercase)'; |
18 |
|
|
} else if (el.localName == 'elementName') { |
19 |
|
|
result.firstChild.data = 'FAIL (as is)'; |
20 |
|
|
} else if (el.localName == 'ELEMENTNAME') { |
21 |
|
|
result.firstChild.data = 'FAIL (uppercase)'; |
22 |
|
|
} else { |
23 |
|
|
result.firstChild.data = 'FAIL'; |
24 |
|
|
} |
25 |
|
|
</script> |
26 |
|
|
</body> |
27 |
|
|
</html> |