Last Updated : 20 May, 2024
The HTML <input type="search"> element creates a search input field. It allows users to enter search queries. It typically includes features like a clear button to easily remove the entered text and may have a search icon to indicate its purpose. This element is useful for implementing search functionality in web forms.
Syntax<input type="search">
Example: This example demonstrates the use of HTML <input type="search"> element.
HTML
<!DOCTYPE html>
<html>
<head>
<title>
HTML Input Type Search
</title>
</head>
<body style="text-align:center;">
<h2>HTML <input type="search"></h2>
<form>
<label for="search_field">Search Text:</label>
<input type="search" id="search_field">
<br><br>
<input type="button" value="Search">
</form>
</body>
</html>
Output
Supported BrowsersRetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4