In this tutorial, you will see the the use of type, alt and image attribute of input tag.
In this tutorial, you will see the the use of type, alt and image attribute of input tag.Here we will introduce you to about the type attribute of input tag. It is define the type of data. which can be insert by user. User can insert only given type of data. It is most important for input tag. The alt attributes can be used with image type of input tag. This string will display when image is not displayed.
Type Attribute:Attribute | Value | Description |
type alt |
hidden text image string |
It hides the field. User can not manipulate data. It is a text field. User can insert a text string without break line. User can insert a image. like a button This string will display when image is not displayed. |
<input type="value" alt="text" /> |
<!doctype html > <html> <head><title>Title of document</title></head> <body> <h1>Input tag.</h1> <h2>Implementation of input tag type, alt attributes.</h2> <form><table style="width: 61%"> <tr> <td style="width: 149px">Type=Hidden </td> <td> </td> <td><input type="Hidden" value="hidden" ></td> </tr> <tr> <td style="width: 149px">Type=Text </td> <td> </td> <td><input type="text" value="RoseIndia"> </td> </tr> <tr> <td style="width: 149px">Type=Image </td> <td> </td> <td> <input type="image" src="RoseIndiaPick.jpg" alt="Type is image" name="RoseIndia" > </td> </tr> <tr> <td style="width: 149px">Type=Image </td> <td> </td> <td><input type="image" src="" alt="Image of submit button" name="Image button"> </td> </tr> </table></form></body> </html> |
The input tag is available in both HTML5 and HTML4.01. But there is some attribute in HTML5, that is not supported by HTML4.01.