You are here: Reference > HTML > tags > input:search

input:search element

Browser support:
Creates a search field. It contains a single-line text input control with a search history dropdown list.
All searches in this field are saved into the search history under the category specified by the autosave attribute. If the autosave attribute of two different search tags contain identical values, the searches belonging to these fields are saved under the same category of the history.
Use a unique category name (for example, the domain where the site is) to avoid the mixing of categories. If the autosave attribute is not defined, then the history dropdown list is invisible, and the searches are not saved into the history.
The results attribute specifies how many elements are visible in the dropdown list of the search history.
This control is one of the form controls.
The contents of the control can be submitted to a server if the following conditions are met:
  • A form element must contain the search control.
  • The action attribute of the container form must be set to the URL of the server.
  • The name attribute of the search control must be specified and non-empty.
When the container form is submitted, the name and the text content of the control are sent as a name/value pair.
If you want to see the HTML tags by categories, please visit this page.
This element cannot have a closing tag.
JavaScript page for this element: input:search.

Possible members:

Sets an access key to an element.
Specifies the name of a category in the search history.
Sets the style class or classes that belong to the element.
Sets whether the contents of the object are editable.
Sets the text direction as related to the lang attribute.
Sets the state of an object for user interaction.
Sets a unique identifier for the object.
Specifies what type of user actions fire the onsearch event.
Specifies the language of the element.
Sets the name of a form control that affects the contents of the message submitted to the server.
Sets the initial value of the text field.
Sets whether the contents of the element are changeable.
Specifies how many elements are visible in the dropdown list of the search history.
Specifies the width of a control, in characters.
Sets an inline style associated with an element.
Specifies the tabbing order for keyboard navigation using the TAB key.
Specifies a tooltip for an element.
Sets the type of the input element.
Specifies the initial value for a control element.

Example HTML code 1:

This example illustrates the use of the search input element:
<form method="post" action="#URL#">
    Search for: <input type="search" name="search" autosave="" results="10" />
    <br /><br />
    <input type="submit" value="Search" />
Did you find this example helpful? yes no

Related pages:

External links:

User Contributed Comments

Post Content

Post Content