HTML and CSS Reference
required ( required="required" in XHTML)
Not in HTML 4.01 . When present, indicates the input value is required. Applies to text ,
password , checkbox , radio , file , email , tel , search , url , number , date , time , date-
time , datetime-local , month , and week .
Specifies the width of a text-entry control, measured in number of characters. Users may
type entries that are longer than the space provided, causing the field to scroll to the right.
Applies to text , password , email , tel , search , and url ,
When the input type is image , this attribute provides the location of the image to be used
as a push button.
Not in HTML 4.01 . Indicates the granularity that is expected and required of the value
by limiting the allowed value to permitted units. The value of this attribute is dependent
on the type of the input control. It may be a number greater than zero or the keyword
any , which allows any unit value. Applies to number , range , date , time , datetime ,
datetime-local , month , and week .
Specifies the data type and associated form control. Descriptions of each input type and
their associated attributes are listed below.
Specifies the initial value for this control. Applies to all input types except image .