Skip to content

Fix: replace document.body.querySelector with document.querySelector#43387

Merged
Josh-Cena merged 4 commits intomdn:mainfrom
jyotsna05-22:main
Mar 27, 2026
Merged

Fix: replace document.body.querySelector with document.querySelector#43387
Josh-Cena merged 4 commits intomdn:mainfrom
jyotsna05-22:main

Conversation

@jyotsna05-22
Copy link
Copy Markdown
Contributor

@jyotsna05-22 jyotsna05-22 commented Mar 9, 2026

Replaced document.body.querySelector with document.querySelector in the DOM examples to follow the correct usage mentioned in the issue.

Fixes #43367

@jyotsna05-22 jyotsna05-22 requested a review from a team as a code owner March 9, 2026 16:57
@jyotsna05-22 jyotsna05-22 requested review from chrisdavidmills and removed request for a team March 9, 2026 16:57
@github-actions github-actions bot added Content:WebAPI Web API docs size/s [PR only] 6-50 LoC changed labels Mar 9, 2026
Copy link
Copy Markdown
Contributor

@chrisdavidmills chrisdavidmills left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @jyotsna05-22 , this makes sense to me.

Can you edit your PR description to include the URL of the related issue, preceded by "Fixes ", so "Fixes https:// ..."

When you include that, when I merge the PR, it will then automatically close the related issue.

@pepelsbey
Copy link
Copy Markdown
Member

There are more document.body.querySelector examples in the article. It would make sense to update them all.

@Josh-Cena Josh-Cena changed the title Fix: replace document.body.querySelector with document.querySelector … Fix: replace document.body.querySelector with document.querySelector Mar 27, 2026
@Josh-Cena Josh-Cena merged commit b6b7abe into mdn:main Mar 27, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Content:WebAPI Web API docs size/s [PR only] 6-50 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Document.querySelector() vs. Element.querySelector()

4 participants