Name
<input>
Synopsis
<input/>
Adds a text-entry field to the document.
Attributes
-
name=text Required. The name of the variable that stores the user input.
-
type=text|password Sets the type of text entry. The default
textallows normal text entry;passwordhides the entered text from view by displaying stars or dots.
-
value=value Provides a default value that displays when the element is loaded.
-
format=format Specifies a format for the entered text to restrict text entry to specific alphanumeric patterns (such as dates or credit card numbers).
-
emptyok Indicates that it is okay to leave the field empty.
-
size=number The width, in characters, of the text entry field.
-
maxlength=number Maximum length of the entered text (in characters).
-
tabindex=number Sets the order in which the form elements are tabbed through.
-
title=text Specifies a description of the text entry screen; the description may or may not be displayed by the browser.
-
accesskey=keypad key Assigns a keypad key to the field for quick access.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access