about summary refs log blame commit diff stats
path: root/test/js/htmlcollection.html
blob: 6231237a2e457805411365f7343b80b8c61b0954 (plain) (tree)





















                                                              
<!doctype html>
<title>HTMLCollection test</title>
<div class="abc">Fail</div>
<style>style 1</style>
<style>style 2</style>
<style>style 3</style>
<script>
(function() {
	const abc = document.getElementsByClassName("abc");
	if (abc.length !== 1) return;
	abc[0].className = "defg";
	if (abc.length !== 0) return;
	const styles = document.getElementsByTagName("style");
	if (styles.length !== 3) return;
	if (styles[0].textContent !== "style 1") return;
	if (styles[1].textContent !== "style 2") return;
	if (styles[2].textContent !== "style 3") return;
	for (const style of styles) style.remove();
	let defg = document.getElementsByClassName("defg");
	defg[0].textContent = "Success";
})()
</script>