Input Element

Input Element

·

1 min read

The HTML element is used to create interactive controls for web-based forms in order to accept data from the user; a wide variety of types of input data and control widgets are available, depending on the device and user agent. The element is one of the most powerful and complex in all of HTML due to the sheer number of combinations of input types and attributes.

The available types are as follows:

type-1.PNG type-2.PNG type-3.PNG

type-4.PNG

Attributes

The element is so powerful because of its attributes; the type attribute, described with examples above, is the most important. Since every element, regardless of type, is based on the HTMLInputElement interface, they technically share the exact same set of attributes. However, in reality, most attributes have an effect on only a specific subset of input types. In addition, the way some attributes impact an input depends on the input type, impacting different input types in different ways.

Attributes for the element include the global HTML attributes and additionally:

attribute-1.PNG attribute-2.PNG attribute-3.PNG