Input Elements
Introduction
The <input>
The HTML element is used to create interactive controls for web-based forms that accept data from the user. Different types of input data and control widgets are available, depending on the device and user agent. This element is one of the most powerful and complex elements in HTML due to the large number of combinations of input types and attributes.
Example
Attributes
This element is very powerful due to its properties. The type attribute described above with examples is the most important. Regardless of the type of each, all elements are based on the HTMLInputElement interface, so technically they share the same set of attributes. However, in practice, most attributes only affect a certain subset of input types. Additionally, the way some attributes affect input depends on the input type and affects different input types differently.
This section has a table with all attributes and a brief description. Following this table is a list that describes each attribute in detail and which input type it is associated with. Those common to most or all input types are defined in detail below. Attributes that are specific to a particular input type, or that are common to all input types but have special behaviour when used with a particular input type, are instead documented on those types' pages.
Subscribe to my newsletter
Read articles from CodeG OnestopCode directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by