w3schools    w3Schools
Search :
   
HOME HTML CSS XML JAVASCRIPT ASP PHP SQL MORE...   References Examples Forum About
ADVERTISEMENTS

XML Certification
Download XML editor
Custom Programming
 
Table of contents
HTML Reference
HTML by Alphabet
HTML by Function
HTML Attributes
HTML Events
HTML Colornames
HTML Character Sets
HTML ASCII
HTML ISO-8859-1
HTML Symbols
HTML URL Encode
HTML Lang Codes
HTTP Messages

HTML Tags
<!-->
<!DOCTYPE>
<a>
<abbr>
<acronym>
<address>
<applet>
<area>
<b>
<base>
<basefont>
<bdo>
<big>
<blockquote>
<body>
<br>
<button>
<caption>
<center>
<cite>
<code>
<col>
<colgroup>
<dd>
<del>
<dfn>
<dir>
<div>
<dl>
<dt>
<em>
<fieldset>
<font>
<form>
<frame>
<frameset>
<head>
<h1> - <h6>
<hr>
<html>
<i>
<iframe>
<img>
<input>
<ins>
<kbd>
<label>
<legend>
<li>
<link>
<map>
<menu>
<meta>
<noframes>
<noscript>
<object>
<ol>
<optgroup>
<option>
<p>
<param>
<pre>
<q>
<s>
<samp>
<script>
<select>
<small>
<span>
<strike>
<strong>
<style>
<sub>
<sup>
<table>
<tbody>
<td>
<textarea>
<tfoot>
<th>
<thead>
<title>
<tr>
<tt>
<u>
<ul>
<var>

Selected Reading
Web Statistics
Web Glossary
Web Hosting
Web Quality

Browse Tutorials
 

HTML input src Attribute


HTML input Tag Reference HTML <input> tag

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

<input src="URL" />

Syntax Example

<input src="input_image.gif" />

Attribute Values

Value Description
URL Specifies URL of the image

Possible values:

  • An absolute URL - Is used to navigate to another web site (like src="http://www.w3schools.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

Internet Explorer Firefox Opera Google Chrome Safari

The attribute is supported in all major browsers.


Example

<form action="">
<input type="image" src="input_image.gif" alt="W3Schools button" />
</form>


Try-It-Yourself Demos

input src attribute example
How use the src attribute with the input type="image".


HTML input Tag Reference HTML <input> tag