HTML <input> src Attribute

Definition and Usage

src The attribute specifies the URL of the image used as the submit button.

Note:src The attribute can only be used with <input type="image"> Used together (and is required).

Example

HTML form containing an image representing the submit button:

<form action="/action_page.php">
  <label for="fname">Name:</label>
  <input type="text" id="fname" name="fname"><br><br>
  <input type="image" src="submit.gif" alt="submit" width="48" height="48">
</form>

Try It Yourself

Syntax

<input src="URL">

Attribute Value

Value Description
URL

Specifies the URL of the image used as the submit button.

Possible Values:

  • Absolute URL - Points to another website (e.g., src="http://www.example.com/submit.gif")
  • Relative URL - Points to a file within the website (e.g., src="submit.gif")

Browser Support

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Support Support Support Support Support