<html> | |
<body> | |
<div id="div" name="divname" item="canoveride"></div> | |
<pre> | |
<script> | |
if (window.testRunner) { | |
testRunner.dumpAsText(); | |
} | |
var hadError = false; | |
var myDiv = document.getElementById("div"); | |
var attribute = myDiv.attributes["name"]; | |
if (attribute != "[object Attr]") { | |
document.writeln('ERROR: attributes["name"] should be an attribute object: ' + attribute); | |
hadError = true; | |
} | |
attribute = myDiv.attributes["item"]; | |
if (attribute.value) { | |
document.writeln('ERROR: attributes["item"].value : ' + attribute.value); | |
hadError = true; | |
} | |
if (!hadError) | |
document.writeln("Success"); | |
</script> | |
</pre> | |
</body> | |
</html> |