function testRemoveAttribute() { var attrTest1 = document.getElementById("attrTest1"); var attr1 = attrTest1.getAttributeNode("testAttr");
var attrTest2 = document.getElementById("attrTest2"); var attr2 = attrTest2.getAttributeNode("testAttr");
ok(attrTest1.hasAttribute("testAttr"), "First object should have attribute");
ok(attrTest2.hasAttribute("testAttr"), "Second object should have attribute");
try {
attrTest1.removeAttributeNode(attr2);
ok(false, "Should throw when removing from the different element");
} catch (e) {
ok(true, "Should throw when removing from the different element");
}
ok(attrTest1.hasAttribute("testAttr"), "Object should not remove attribute which not belongs to it");
ok(attrTest2.hasAttribute("testAttr"), "Object should not be changed");
attrTest1.removeAttributeNode(attr1);
ok(!attrTest1.hasAttribute("testAttr"), "Object should remove its attribute");
}
testRemoveAttribute();
</script>
</pre>
</body>
</html>
Messung V0.5
¤ Dauer der Verarbeitung: 0.11 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.