HTML <input> src属性

❮HTML<input>タグ

送信ボタンを表す画像を含むHTMLフォーム:

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

定義と使用法

このsrc属性は、送信ボタンとして使用する画像のURLを指定します。

注:このsrc属性は、でのみ使用できます(およびに必要です)<input type="image">


ブラウザのサポート

表の数字は、属性を完全にサポートする最初のブラウザーバージョンを示しています。

Attribute
src Yes Yes Yes Yes Yes

構文

<input src="URL">

属性値

Value Description
URL Specifies the URL of the image to use as a submit button.

Possible values:

  • An absolute URL - points to another web site (like src="http://www.example.com/submit.gif")
  • A relative URL - points to a file within a web site (like src="submit.gif")

❮HTML<input>タグ