Black Lives Matter! ✊🏾

type="search"

The difference between the Text state and the Search state is primarily stylistic: on platforms where search fields are distinguished from regular text fields, the Search state might result in an appearance consistent with the platform’s search fields rather than appearing like a regular text field. 4.10.5.1.2. Text (type=text) state and Search state (type=search)

Links about type="search"

  1. Maybe Ignore type=search

    posted on

    Another case of the headline saying it all. If you have a valid, accessible search field (with a useful, sensible label) then you can probably ignore type=”search” and use type=”text” instead. I made a code sample you can use for testing in your preferred set-up; it is what I used…

  2. <input type=“search”>

    posted on by MDN

    input elements of type search are text fields designed for the user to enter search queries into. These are functionally identical to text inputs, but may be styled differently by the user agent.

Code sample

<label for="search">Search:</label>
<input type="search" id="search">