mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 22:17:45 +00:00
LibWeb: Return a HTMLFormControlsCollection from HTMLFormElement element
Instead of a HTMLCollection
This commit is contained in:
parent
27dd2a40ad
commit
9cf5b67162
5 changed files with 39 additions and 7 deletions
24
Tests/LibWeb/Text/input/html-form-controls-collection.html
Normal file
24
Tests/LibWeb/Text/input/html-form-controls-collection.html
Normal file
|
@ -0,0 +1,24 @@
|
|||
<form>
|
||||
<input name="one" id="my-form-control" type="button" />
|
||||
<input name="two" id="my-form-control" type="text" />
|
||||
</form>
|
||||
<script src="include.js"></script>
|
||||
<script>
|
||||
test(() => {
|
||||
const formElements = document.forms[0].elements;
|
||||
const radioNodeList = formElements.namedItem("my-form-control");
|
||||
|
||||
println(formElements.constructor.name);
|
||||
println(radioNodeList.constructor.name);
|
||||
println(radioNodeList.length);
|
||||
println(radioNodeList[0].type);
|
||||
println(radioNodeList[1].type);
|
||||
|
||||
const nonMatching = formElements.namedItem("no match");
|
||||
println(nonMatching);
|
||||
|
||||
const singleElement = formElements.namedItem("two");
|
||||
println(singleElement.constructor.name);
|
||||
println(singleElement.type);
|
||||
})
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue