Skip to content

Clarify required attribute behavior for select elements#44440

Open
KirtiRamchandani wants to merge 1 commit into
mdn:mainfrom
KirtiRamchandani:fix/select-required-attribute-description
Open

Clarify required attribute behavior for select elements#44440
KirtiRamchandani wants to merge 1 commit into
mdn:mainfrom
KirtiRamchandani:fix/select-required-attribute-description

Conversation

@KirtiRamchandani

Copy link
Copy Markdown
Contributor

Summary

Updates the <select> element documentation for the required attribute so it matches HTML constraint validation.

The previous text said an option with a non-empty string value must be selected. That is incorrect: a selected option with an empty value can satisfy the requirement when it is not the placeholder label option.

Testing

  • corepack npm exec --yes --package=prettier@3.8.4 -- prettier --check files/en-us/web/html/reference/elements/select/index.md
  • corepack npm exec --yes --package=markdownlint-cli2@0.22.1 --package=markdownlint-rule-search-replace@1.2.0 -- markdownlint-cli2 files/en-us/web/html/reference/elements/select/index.md
  • git diff --check

Fixes #44397

Describe placeholder label option handling and note that empty
option values can satisfy the requirement when selected.
@KirtiRamchandani KirtiRamchandani requested a review from a team as a code owner June 13, 2026 16:15
@KirtiRamchandani KirtiRamchandani requested review from estelle and removed request for a team June 13, 2026 16:15
@github-actions github-actions Bot added Content:HTML Hypertext Markup Language docs size/xs [PR only] 0-5 LoC changed labels Jun 13, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Preview URLs (1 page)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Content:HTML Hypertext Markup Language docs size/xs [PR only] 0-5 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

incorrect <select> required attribute description

2 participants