Search...

HTML Input Attributes

This chapter describes the different attributes for the HTML <input> element.

The value Attribute

The `value` attribute specifies an initial value for an input field:

Value Attribute Example
Result

The readonly Attribute

The `readonly` attribute specifies that an input field is read-only. A read-only input field cannot be modified (however, a user can tab to it, highlight it, and copy the text from it).

Readonly Attribute Example
Result

The disabled Attribute

The `disabled` attribute specifies that an input field should be disabled. A disabled input field is unusable and un-clickable. The value of a disabled input field will not be sent when submitting the form!

Disabled Attribute Example
Result

The placeholder Attribute

The `placeholder` attribute specifies a short hint that describes the expected value of an input field (e.g. a sample value or a short description of the expected format).

Placeholder Attribute Example
Result