What is input tag all attributes list with example?
Input tag attributes are used to design forms in html.lets see input tag attributes list with some example:
- name
- multiple
- checked
- disabled
- placeholder
- form
- read only
- formaction
- Required
- form method
- size
- List
- Src
- Step
- Maxlength
- Value
- Width
How to use these input tag attributes lets start practice;
<HTML>
<HEAD>
<TITLE>
HOW MANT INPUT TAG ATTRIBUTE.
</TITLE>
</HEAD>
<BODY>
<FORM>
NAME:<BR>
- <INPUT TYPE="TEXT" NAME="USER NAME" AUTOFOCUS>
Autofocus automatically highlights that fill in this. Automatically ,we see there curser.
EMAIL ADRESS:<BR>
- <INPUT TYPE="TEXT' NAME="EMAIL ADRESS" PLACEHOLDER="ENTER YOUR EMAIL ADRESS">
EMAIL ADRESS:<BR>
- <INPUT TYPE="TEXT' NAME="EMAIL ADRESS" disabled>
no changes the user can ,is use of disabled here the user cannot enter your email adress because we use the disabled tag..
EMAIL ADRESS:<BR>
- <INPUT TYPE="TEXT' NAME="EMAIL ADRESS" READONLY VALUE="THIS TEXT FOR ONLY READ">
- UPLOAD FILE:<BR>
<INPUT TYPE="FILE" NAME="FILE">
Here you an upload any file which you want such as audio, video,or images.
If you want to upload only audio file then use the another tag which is accept tag.
- UPLOAD FILE:<BR>
<INPUT TYPE="FILE" NAME="FILE" ACCEPT="AUDIO/*">
Similarly, you can upload video or images as .
UPLOAD FILE:<BR>
<INPUT TYPE="FILE" NAME="FILE" ACCEPT="images/*" multiple>.
If we want to upload multiple then we use the multiple tag.
FATHER NAME:<BR>
<INPUT TYPE="TEXT" NAME="FATHER NAME" REQUIRED>
Required means necessary. We see many registration forms. If we miss any box to fill. And then submit that form .The form cannot submitted and written as please fill out all field this is because of required tag in html..
CITY:<BR>
<INPUT LIST="CITY">
<DATALIST ID ="CITY">
<OPTION VALUE="DGKHAN">
<OPTION VALUE="MULTAN">
<OPTION VALUE="JAMPUR">
</DATALIST>
in any registration form ,we also to select city or country in a given list. This is because of input list tag which is very amazing and easy to understand.
NUMBER:<BR>
- <INPUT TYPE="NUMBER">
here number are given but that has no limit.
- <INPUT TYPE="NUMBER" maxlength="10">
</form>
</body>
</html>