top | item 37574598

(no title)

jensimmons | 2 years ago

You are correct that <div `role=search`> functions the same way that <search> does. But the search element includes the proper support for accessibility by default, where the ARIA role requires a developer to remember to use it.

Plus semantic HTML provides untold assistance for bots, to help them understand the web page — whether that's a search engine bot, machine learning, reader mode, translation engines, or any other computerized system looking to understand the page. Semantic HTML conveys more human meaning to the machines.

discuss

order

shadowgovt|2 years ago

> But the search element includes the proper support for accessibility by default, where the ARIA role requires a developer to remember to use it.

The `<search>` element also requires the developer to remember to use it. If the developer omits the `<search>` wrapping from the search elements or replaces it with a `<div>`, it'll still "work" (except accessibility won't be wired up), same as if they omit `role=search` from another tag.

> Plus semantic HTML provides untold assistance for bots, to help them understand the web page — whether that's a search engine bot, machine learning, reader mode, translation engines, or any other computerized system looking to understand the page. Semantic HTML conveys more human meaning to the machines.

I'm failing to see how the human meaning conveyed by a `role=search` attribute isn't completely isomorphic to the meaning conveyed by a `<search>` element.