Easy Tutorial
❮ Prop Loc Search Dom Obj Object ❯

HTML DOM Input Search Object


Input Search Object

The Input Search object represents an HTML <input> element with type="search".

Accessing the Input Search Object

You can access an <input> element with the type="search" attribute using the getElementById() function:

Tip: You can also access the Input Search object through the elements collection of the form.

Creating an Input Search Object

You can create an <input> element with the type="search" attribute using the document.createElement() method:

Input Search Object Properties

Property Description
autocomplete Sets or returns the autocomplete attribute value of the search field
autofocus Sets or returns whether the search field should automatically get focus when the page loads
defaultValue Sets or returns the default value of the search field
disabled Sets or returns whether the search field is enabled or disabled
form Returns a reference to the form that contains the search field
list Returns a reference to the datalist that contains the search field
maxLength Sets or returns the maxLength attribute value of the search field
name Sets or returns the name attribute value of the search field
pattern Sets or returns the pattern attribute value of the search field
placeholder Sets or returns the placeholder attribute value of the search field
readOnly Sets or returns whether the search field is read-only
required Sets or returns whether the search field is required in the form
size Sets or returns the size attribute value of the search field
step Sets or returns the step attribute value of the search field
type Returns the form element type of the search field
value Sets or returns the value attribute value of the search field

Standard Properties and Events

The Input Search object also supports standard properties and events.


Related Articles

HTML Tutorial: HTML Forms

HTML Reference: HTML <input> Tag

HTML Reference: HTML <input> type Attribute

❮ Prop Loc Search Dom Obj Object ❯