Attributes · <input type="search">
Which HTML Input Type Search attributes matter?
These attributes decide how the <input type="search"> behaves and what actually gets emailed to your inbox when someone submits.
| Attribute | What it does | Docs |
|---|---|---|
name | The key the query is sent under. q is the usual name, so the URL ends in ?q=.... Without a name, nothing is sent. | |
enterkeyhint | Use search so mobile keyboards label the Enter key as Search. | MDN |
placeholder | An example query, like e.g. contact form. It disappears on typing, so it is not a label. | MDN |
minlength / maxlength | The fewest and most characters allowed. minlength only checks a field that isn't empty. | MDN |
list | The id of a <datalist> whose options show as suggestions. Visitors can still type anything. | |
spellcheck | Set spellcheck="false" to stop red underlines on product names and codes. | MDN |




