Definition and Usage The src attribute specifies the URL of the image to display as a button. The src attribute should always be set when ...
Definition and Usage
The src attribute specifies the URL of the image to display as a button.
The src attribute should
always be set when the type attribute of the input element is set to "image".
Syntax
Syntax Example
<input src="input_image.gif" /> |
Attribute Values
Value | Description |
URL | Specifies URL of the imagePossible values:
- An absolute URL - Is used to navigate to another web site (like src="http://www.1000sourcecodes.com/image.gif")
- A relative URL - Is used to navigate within a site (like src="image.gif")
Note: This attribute is optional. However, it should be required whenever the input type is set to "image". |
Browser Support
The attribute is supported in all major browsers.
Example
<form action="">
<input type="image" src="input_image.gif" alt="button" />
</form> |