Basic info:
- Node.js version: 18
- jsdom version: 22
Minimal reproduction case
import jsdom from "jsdom";
const { JSDOM } = jsdom;
const dom = new JSDOM(`
<!doctype html>
<html>
<head></head>
<body>
<form>
<input name="one" value="" />
<input name="two" value="" />
</form>
</body>
</html>
`);
console.log(dom.window.document.forms.length); // 1
console.log(dom.window.document.forms[0].length); // 2
// this should report `HTMLInputElement {}` but doesn't
console.log(dom.window.document.forms[0][0]); // undefined <--- !!!
How does similar code behave in browsers?
Index access on a form object to access its form elements in browsers returns the form's element node found at that index. Attempting the same thing in JSDOM returns undefined.
Relevant portion from the spec
https://html.spec.whatwg.org/multipage/forms.html#htmlformelement

Basic info:
Minimal reproduction case
How does similar code behave in browsers?
Index access on a form object to access its form elements in browsers returns the form's element node found at that index. Attempting the same thing in JSDOM returns
undefined.Relevant portion from the spec
https://html.spec.whatwg.org/multipage/forms.html#htmlformelement