haikuwebkit/LayoutTests/fast/dom/getElementsByClassName/conflict-tag-name.html

18 lines
535 B
HTML

<!DOCTYPE html>
<script src="../../../resources/js-test.js"></script>
<foo id="a"></foo>
<div id="b" class="foo"></div>
<script>
description("Checks that getElementsByClassName('foo') and getElementsByTagName('foo') do not conflict");
var withFooTag = document.getElementsByTagName("foo");
shouldBe("withFooTag.length", "1");
shouldBeEqualToString("withFooTag[0].id", "a");
var withFooClass = document.getElementsByClassName("foo");
shouldBe("withFooClass.length", "1");
shouldBeEqualToString("withFooClass[0].id", "b");
</script>