Dofactory.com
Dofactory.com
Earn income with your HTML skills
Sign up and we'll send you the best freelance opportunities straight to your inbox.
We're building the largest freelancing marketplace for people like you.
By adding your name & email you agree to our terms, privacy and cookie policies.

HTML <input> src Attribute

The src attribute on an <input> tag specifies the URL or path of an image.

The browser uses the URL to locate and load the image file.

This attribute is only used by input elements of type image.

Example

#

A src attribute on an image <input>.
The attribute references an image with an arrow.






<form action="/tutorial/action.html">
  <label for="firstname">First name</label><br />
  <input type="text" id="firstname" name="firstname"><br />
  <label for="lastname">Last name</label><br />
  <input type="text" id="lastname" name="lastname"><br /><br />

  <input type="image" src="/img/html/arrow.png" 
         width="40" height="40" alt="Submit">
</form>

Using src

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

The URL of the image file can be internal (from same website) or external (another website).


Syntax

<input src="URL">

Values

#

Value Description
URL URL or path to an image.

Browser support

Here is when src support started for each browser:

Chrome
1.0 Sep 2008
Firefox
1.0 Sep 2002
IE/Edge
1.0 Aug 1995
Opera
1.0 Jan 2006
Safari
1.0 Jan 2003

You may also like

 Back to <input>

Last updated on Sep 30, 2023

Earn income with your HTML skills
Sign up and we'll send you the best freelance opportunities straight to your inbox.
We're building the largest freelancing marketplace for people like you.
By adding your name & email you agree to our terms, privacy and cookie policies.

Guides