The HTML Form Attribute element is used to create interactive controls for web-based forms in order to accept data from the user. This attributes can be used on the following elements such as :
The value
attribute specifies the initial value for an input field.
The readonly
attribute specifies that the input field is read only that means the value of input field cannot be changed.
The disabled
attribute specifies that the input field is disabled. You cannot make any modification on input field.
The size
attribute specifies the size for the input field in character.
The maxlength
attribute specifies the maximum length allowed for the input field.
Here is a list of some common Attributes in HTML 5.
Attribute | Description | |
---|---|---|
autocomplete | It gives the autocomplete functionality to the form. | |
autofocus | It make sure that the input field automatically get focused when the page loads. | |
form | It specifies one or more forms, an <input> element belongs to. | |
formaction | It specifies the URL of a file where the form data will get transferred and processed after submitting. | |
formenctype | It specifies how the form data should be encoded when submitted. | |
formmethod | It defines the HTTP method for sending form-data to the action URL. | |
formnovalidate | It specifies that the <input> element should not be validated. | |
formtarget | It specifies where to display the response that is received after submitting the form. Ex. - _blank, _self, framename, etc. | |
height & width | It specifies the height and width of an <input> element. | |
list | It's value gives a particular id to a <datalist> element that contains pre-defined options for an <input> element. | |
min and max | It specifies the minimum and maximum values for an <input> element. | |
multiple | It allows the user to enter more than one value in the <input> element. | |
pattern (regexp) | It defines a regular expression for an <input> element's value. | |
placeholder | It gives a hint about the value to be entered in the <input> element. | |
required | It specifies that an input field must be filled out before submitting the form. | |
step | It specifies the legal number intervals for an <input> element. |
Follow Us: