blob: 2b5b498395d436bcb56c2737f5039addf809510e (
plain) (
tree)
|
|
<!doctype html>
<title>HTMLCollection test</title>
<div class="abc">Fail</div>
<style>style 0</style>
<style>style 1</style>
<style>style 2</style>
<script src=asserts.js></script>
<script>
const abc = document.getElementsByClassName("abc");
assert_equals(abc.length, 1);
abc[0].className = "defg";
assert_equals(abc.length, 0);
const styles = document.getElementsByTagName("style");
assert_equals(styles.length, 3);
for (let i = 0; i < styles.length; ++i)
assert_equals(styles[i].textContent, "style " + i);
for (const style of styles)
style.remove();
const defg = document.getElementsByClassName("defg");
defg[0].textContent = "Success";
</script>
|