HTMLSelectElement.namedItem does not take the name attribute into account

Confirmed Issue #6712791 • Assigned to Kris K.

Details

Created
Feb 29, 2016
Privacy
This issue is public.
Reports
Reported by 1 person

Sign in to watch or report this issue.

Steps to reproduce

URL:

Repro Steps:

var s = document.createElement( ‘select’ ), o;
o = document.createElement( ‘option’ );
o.setAttribute( 'name’, ‘asd’ );
s.appendChild( o );
s.namedItem( ‘asd’ );
=> null

o.setAttribute( 'id’, ‘asd’ );
s.namedItem( ‘asd’ );
=> <option id="asd" name="asd"></option>

Expected Results:

Name attribute of options is taken into account.

Actual Results:

Dev Channel specific:

No

Attachments

0 attachments

    Comments and activity

    • Microsoft Edge Team

      Changed Assigned To to “Mara P.”

      Changed Assigned To to “Travis L.”

      Changed Status to “Confirmed”

    • I posted this in Connect but my comment seems to have gone missing:

      https://msdn.microsoft.com/en-us/library/ms536634(v=vs.85).aspx says:

      This method first searches for an object with a matching id attribute. If a match is not found, the method searches for an object with a matching name attribute, but only on those elements that are allowed a name attribute.

      Is it possible that the name attribute is not considered to be allowed on option elements? https://www.w3.org/TR/html-markup/option.html#option-constraints

    • Microsoft Edge Team

      Changed Assigned To from “Travis L.” to “Steven K.”

      Changed Assigned To from “Steven K.” to “Travis L.”

      Changed Assigned To from “Travis L.” to “Kris K.”

    You need to sign in to your Microsoft account to add a comment.

    Sign in