Skip to content

Document.querySelector() vs. Element.querySelector() #43367

@whxvd

Description

@whxvd

MDN URL

https://developer.mozilla.org/en-US/docs/Web/API/Document_Object_Model

What specific section or headline is this issue about?

Examples

What information was incorrect, unhelpful, or incomplete?

The first two examples start with notes that Document.querySelector() is used. But both examples use document.body.querySelector, i.e., Element.querySelector() instead Document.querySelector().

What did you expect to see?

The first two examples probably could use document.querySelector instead of document.body.querySelector.

Do you have any supporting links, references, or citations?

No response

Do you have anything more you want to share?

No response

MDN metadata

Page report details

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions