Add iterable support to NodeList et al. was: (JavaScript Bug When Referencing Variable Storing Attribute Selector String)

Confirmed Issue #10232708 • Unassigned

Details

Author
John D.
Created
Dec 16, 2016
Privacy
This issue is public.
Found in
  • Microsoft Edge
  • Internet Explorer
Reports
Reported by 1 person

Sign in to watch or report this issue.

Steps to reproduce

I have an attribute selector stored as a string. I pass it as an argument to querySelectorAll as in the code below. An error is thrown. See screenshot.

const ITEM = '[data-showflex="container"]',
    STATECLASS = 'show';

function showAllItems() {
    document.querySelectorAll(ITEM).forEach((item) => item.classList.add(STATECLASS));
}
function hideAllItems() {
    document.querySelectorAll(ITEM).forEach((item) => item.classList.remove(STATECLASS));
}

Attachments

1 attachment

Comments and activity

  • Microsoft Edge Team

    Changed Assigned To to “Brad E.”

    Changed Assigned To to “Travis L.”

    Changed Assigned To from “Travis L.” to “Jeff W.”

    Changed Status to “Confirmed”

    Changed Title from “JavaScript Bug When Referencing Variable Storing Attribute Selector String” to “Add iterable support to NodeList et al. was: (JavaScript Bug When Referencing Variable Storing Attribute Selector String)”

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

Sign in