RESOLVED DUPLICATE of bug 87834223712
HTMLFormElement.elements should not return images
https://bugs.webkit.org/show_bug.cgi?id=223712
Summary HTMLFormElement.elements should not return images
Marvin Scholz
Reported 2021-03-24 13:55:52 PDT
According to https://html.spec.whatwg.org/multipage/forms.html#category-listed the HTMLFormElement elements property should not list img elements in forms, this does seem to work fine, except when explicitly accessing by ID. For example given the following HTML: <form id="test_form"> <input type="text" name="example_text_input"> <img alt="example" id="test_img" width="10" height="10" src="…"> </form> Querying the elements with the img id like this: document.forms['test_form'].elements['test_img'] should return undefined, like it happens in other browsers (tested with Firefox and Chrome), but it actually returns the img element. Possibly related to #87834
Attachments
Sam Sneddon [:gsnedders]
Comment 1 2021-03-27 08:39:52 PDT
*** This bug has been marked as a duplicate of bug 87834 ***
Note You need to log in before you can comment on or make changes to this bug.