CREATE A SEARCH INPUT TYPE

You can use the search input type, new in HTML5, to create an input field designed to support a search query. Supported web browsers will apply additional user interface elements to make the query prompt more functional:

<input type='search' name='field' value='query'>

The type='search' attribute value activates the search-specific input options of the user’s web browser, if supported. Additional input element attributes, such as name and value, have the same meaning and functionality common in HTML forms.

At a fundamental level, the search input type simply acts like a text input type, except for some very minor user interface changes. Specifically, in Chrome, an X appears to the right of the text field; clicking ...

Get HTML5: Your visual blueprint™ for designing rich web pages and applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.