What are HTML Input Attributes?
There are different html form attributes.
The value Attribute
The size Attribute
The value attribute specifies the initial value for an input field.
<form action=""> Name:<br> <input type="text" name="name" value="Jack"> </form> |
The readonly Attribute
The readonly attribute specifies that the input field is read only it cannot be changed.
<form action=""> Name:<br> <input type="text" name="name" value="Jack" readonly> </form> |
The disabled Attribute
The disabled attribute specifies that the input field is disabled.
A disabled input field is unusable and un-clickable, and its value will not be sent when submitting the form.
<form action=""> Name:<br> <input type="text" name="name" value="Jack" disabled> </form> |
The size attribute specifies the size for the input field in characters.
<form action=""> Name:<br> <input type="text" name="name" value="Jack" size="20"> </form> |
The maxlength Attribute
The maxlength attribute specifies the maximum length allowed for the input field.
<form action=""> Name:<br> <input type="text" name="name" value="Jack" maxlength="20"> </form> |
HTML
Ayesha
Tech writer at newsandstory
Total 792 views