blob: 56e36f5bdfcb83b94e176dfc1739d5df674d2754 [file] [log] [blame]
<html>
<head>
<script src="../../../resources/js-test-pre.js"></script>
</head>
<body>
<p id="description"></p>
<form name="f">
<ul>
<li>Radio button:
<input type="radio" name="rb2"/>Male
<input type="radio" name="rb2"/>Female
</li>
<li>Checkbox:
<input type="checkbox" name="cb1"/>1
</li>
<li>Checkbox:
<input type="checkbox" name="cb2"/>1
<input type="checkbox" name="cb2"/>2
</li>
</ul>
</form>
<br>
<div id="console"></div>
<script>
description("Multiple radio buttons/checkboxes with the same name should map to a countable collection object when accessed through either document.form.name or document.getElementsbyName(). There is no standardization for what that object is called (Collection, NodeList, HTMLCollection, etc.), nor is it always the same for both methods of access.");
shouldBe("typeof document.f.cb0", "'undefined'");
shouldBe("document.f.cb1.nodeName", "'INPUT'");
shouldBe("document.f.cb2.length", "2");
shouldBe("document.f.rb2.length", "2");
shouldBe("document.getElementsByName('cb2').length", "2");
shouldBe("document.getElementsByName('rb2').length", "2");
</script>
<script src="../../../resources/js-test-post.js"></script>
</body>
</html>