dai11y 28/03/2023 – HTML gains a ‘search’ element

Your daily frequent11y newsletter, brought to you by @ChrisBAshton:

HTML gains a <search> element

This one came up in the work chat.

On 24th March, the “WhatWG HTML living standard” gained a new <search> element. It is intended to be used to contain a set of form controls “related to performing a search or filtering operation”. Example code snippet:

<search>
  <form action="search.php">
    <label for="query">Find an article</label>
    <input id="query" name="q" type="search">
    <button type="submit">Go!</button>
  </form>
</search>

Functionally, it is the equivalent of using <div role="search">. The contributors that proposed it did not like the fact that this could only be expressed in ARIA (after all, the first rule of ARIA is to not use ARIA). See the original issue and the resulting pull request.

Quite what this means for browsers is hazy. WHATWG is a community with oversight from Apple, Google, Mozilla and Microsoft (i.e. the companies that build our browsers) so it should be supported in browsers at some point, but there is no clear timeline. See the WHATWG FAQ for details.


Prefer longer newsletters? You can subscribe to week11y, fortnight11y or even month11y updates! Every newsletter gets the same content; it is your choice to have short, regular emails or longer, less frequent ones. Curated with ♥ by developer @ChrisBAshton.

Loading...