Movatterモバイル変換


[0]ホーム

URL:


  1. Веб-технологии для разработчиков
  2. HTML
  3. Справка по HTML
  4. Элемент
  5. <input>
  6. <input type="image">

This page was translated from English by the community.Learn more and join the MDN Web Docs community.

View in EnglishAlways switch to English

<input type="image">

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since ⁨июль 2015 г.⁩.

<input type="image"> - это кнопка отправки в виде изображения. Вы можете использовать атрибут src, чтобы выбрать источник изображения и атрибут alt, чтобы добавить альтернативный текст. Атрибутами width и height можно указать размер изображения в пикселях.

Разрешённое содержимоеНету, это пустой элемент.
Необязательный закрывающийся тегОбязательно должен быть открывающийся тег, и обязательно отсутствует закрывающий.
Разрешённые родительские элементыЛюбой элемент, которому доступен фразообразующий контент (phrasing content).
DOM-интерфейсHTMLInputElement

Атрибуты

Этому элементу доступны глобальные атрибуты (global attributes).

type

formaction

The URI of a program that processes the information submitted by the input element, here image if specified, it overrides theaction attribute of the element's form owner.

formenctype

If the input element is an image, this attribute specifies the type of content that is used to submit the form to the server. Possible values are:

  • application/x-www-form-urlencoded: The default value if the attribute is not specified.
  • multipart/form-data: Use this value if you are using an<input> element with thetype attribute set tofile.
  • text/plain If this attribute is specified, it overrides theenctype attribute of the element's form owner.
formmethod

In image input element, this attribute specifies the HTTP method that the browser uses to submit the form. Possible values are:

  • post: The data from the form is included in the body of the form and is sent to the server.
  • get: The data from the form is appended to theform attribute URI, with a '?' as a separator, and the resulting URI is sent to the server. Use this method when the form has no side-effects and contains only ASCII characters.If specified, this attribute overrides themethod attribute of the element's form owner.
formnovalidate

This Boolean attribute specifies that the form is not to be validated when it is submitted. If this attribute is specified, it overrides thenovalidate attribute of the element's form owner.

formtarget

This attribute is a name or keyword indicating where to display the response that is received after submitting the form. This is a name of, or keyword for, abrowsing context (for example, tab, window, or inline frame). If this attribute is specified, it overrides thetarget attribute of the element's form owner. The following keywords have special meanings:

  • _self: Load the response into the same browsing context as the current one. This value is the default if the attribute is not specified.
  • _blank: Load the response into a new unnamed browsing context.
  • _parent: Load the response into the parent browsing context of the current one. If there is no parent, this option behaves the same way as_self.
  • _top: Load the response into the top-level browsing context (that is, the browsing context that is an ancestor of the current one, and has no parent). If there is no parent, this option behaves the same way as_self.
height

This attribute defines the height of the image displayed for the button.

required

This attribute specifies that the user must fill in a value before submitting a form but it cannot be used when thetype attribute isimage type (submit,reset, orbutton). The:optional and:required CSS pseudo-classes will be applied to the field as appropriate.

src

This attribute specifies a URI for the location of an image to display on the graphical submit button; otherwise it is ignored.

usemap

The name of a<map> element as an image map.

width

This attribute defines the width of the image displayed for the button.

Примеры

Поле в виде логотипа Firefox

html
<input type="image" name="image" src="fxlogo.png" width="50" />

Результат

Спецификации

Specification
HTML
# image-button-state-(type=image)

Совместимость с браузерами

Смотрите также

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp