docs: clarify difference between Document.querySelector() and Element.querySelector()#43476
docs: clarify difference between Document.querySelector() and Element.querySelector()#43476dsk-dev-ai wants to merge 13 commits intomdn:mainfrom
Conversation
|
Preview URLs (1 page) (comment last updated: 2026-03-21 05:23:41) |
pepelsbey
left a comment
There was a problem hiding this comment.
Thank you for trying to help! Unfortunately, it doesn't address the mentioned issue: you're even changing a different page. Please read carefully what the issue is all about.
Thank you for clarification, I try to figure out things and update that... |
dsk-dev-ai
left a comment
There was a problem hiding this comment.
Thanks for the feedback!
I have updated the PR to add a concise clarification in the main description section instead of introducing a new section, keeping the change aligned with the issue scope.
Please let me know if anything else should be adjusted.
Clarify the behavior of Document.querySelector() and Element.querySelector() in the note section.
dsk-dev-ai
left a comment
There was a problem hiding this comment.
I resolved the issue of failing
|
plz review it |
|
I just noticed it's a duplicate PR. It's already being fixed: #43387 |
Thank you for explaination |
Description
Adds a clarification explaining the difference between
Document.querySelector()andElement.querySelector().Motivation
This distinction is a common source of confusion for developers. The documentation previously did not clearly explain the scope difference between these two methods. This update helps readers better understand how each method works in practice.
Additional details
No functional changes. This is a documentation improvement with a simple example to illustrate the difference.
Related issues and pull requests
Fixes #43367
Relates to #43367