-we can directly click on the labelled input or textarea and access the input box.
for: The for attribute value matches the id attribute of the associated form control. This association informs screen readers and assists in making the label clickable.
-In HTML, the <input> element is used to create interactive form controls that allow users to enter and submit data.
-It is one of the fundamental elements for building forms and collecting user input on websites.
Attribute
|
Description
|
type
|
specify the input control
'text' , 'password' , 'number' , 'checkboxes' , etc.
|
Name
|
provides the name for the input control.
|
value
|
set the initial value for the input control
|
placeholder
|
gives short hint what will come in that input
|
required
|
give the importance to the input, the form cant be submitted if all required inputs are not filled.
|
autocomplete
|
it shows all previous entries within a drop down page.
|
min-max
|
this provide upper and lower limit to the range specific input type.
|
pattern
|
it ask user to input in a specific order only
|
autofocus
|
can be used only once in a page, it directly focuses the cursor to the input box.
|
step
|
for a number type input, on each change with the arrow key the number of steps it will jump is decided by this.
|
cols
|
decides the number of columns in textarea.
|
rows
|
decides the number of rows in textarea.
|