HTML input Tag src Attribute Tutorial

In this section, we will learn what the src attribute is and how to use it.

What is src Attribute in HTML <input> Tag?

HTML <input> element of type “image” is used to bring an external image and use it as a button to submit a form data. (Basically, it’s a way of creating a button but in a form of an image).

The src attribute is used in an <input> element of type “image” to set the URL address of that external image.

HTML src Attribute in <input> Tag Syntax:

<input type = “image” src = “image address”>

<input> Tag src Attribute Values

The value of the src attribute is any relative or absolute URLs that refers to a picture.

Example: using src attribute in HTML <input> tag

See the Pen using src attribute in HTML <input> tag by Omid Dehghan (@odehghan) on CodePen.

Facebook
Twitter
Pinterest
LinkedIn

Top Technologies