--- title: slug: Web/HTML/Element/Input/image translation_of: Web/HTML/Element/input/image ---

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

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

Атрибуты

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

{{htmlattrdef("type")}}

{{htmlattrdef("formaction")}} {{HTMLVersionInline("5")}}
The URI of a program that processes the information submitted by the input element, here image if specified, it overrides the {{htmlattrxref("action","form")}} attribute of the element's form owner.
{{htmlattrdef("formenctype")}} {{HTMLVersionInline("5")}}
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:

If this attribute is specified, it overrides the {{htmlattrxref("enctype","form")}} attribute of the element's form owner.

{{htmlattrdef("formmethod")}} {{HTMLVersionInline("5")}}
In image input element, this attribute specifies the HTTP method that the browser uses to submit the form. Possible values are:

If specified, this attribute overrides the {{htmlattrxref("method","form")}} attribute of the element's form owner.

{{htmlattrdef("formnovalidate")}} {{HTMLVersionInline("5")}}
This Boolean attribute specifies that the form is not to be validated when it is submitted. If this attribute is specified, it overrides the {{htmlattrxref("novalidate","form")}} attribute of the element's form owner.
{{htmlattrdef("formtarget")}} {{HTMLVersionInline("5")}}
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, a browsing context (for example, tab, window, or inline frame). If this attribute is specified, it overrides the {{htmlattrxref("target", "form")}} attribute of the element's form owner. The following keywords have special meanings:
{{htmlattrdef("height")}} {{HTMLVersionInline("5")}}
This attribute defines the height of the image displayed for the button.
{{htmlattrdef("required")}} {{HTMLVersionInline("5")}}
This attribute specifies that the user must fill in a value before submitting a form but it cannot be used when the type attribute is image type (submit, reset, or button). The {{cssxref(":optional")}} and {{cssxref(":required")}} CSS pseudo-classes will be applied to the field as appropriate.
{{htmlattrdef("src")}}
This attribute specifies a URI for the location of an image to display on the graphical submit button; otherwise it is ignored.
{{htmlattrdef("usemap")}} {{HTMLVersionInline(4)}} only, {{obsoleteGeneric("inline", "HTML5")}}
The name of a {{HTMLElement("map")}} element as an image map.
{{htmlattrdef("width")}} {{HTMLVersionInline("5")}}
This attribute defines the width of the image displayed for the button.

Примеры

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

<input type="image" name="image" src="https://mdn.mozillademos.org/files/2917/fxlogo.png" width="50">

Результат

{{ EmbedLiveSample('simple_input_image_example') }}

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

Спецификация Статус
{{SpecName('HTML WHATWG', 'forms.html#image-button-state-(type=image)', '<input type="image">')}} {{Spec2('HTML WHATWG')}}
{{SpecName('HTML5 W3C', 'forms.html#image-button-state-%28type=image%29', '<input type="image">')}} {{Spec2('HTML5 W3C')}}
{{SpecName('HTML4.01', 'interact/forms.html#h-17.4', '<form>')}} {{Spec2('HTML4.01')}}

Браузерная совместимость

{{CompatibilityTable}}

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Базовая поддержка 1.0 {{CompatGeckoDesktop("1.7 or earlier")}} 2 или ранее 1.0 1.0
type 1.0 {{CompatGeckoDesktop("1.7 or earlier")}} 2 1.0 1.0
type=image 1.0 Gecko 2.0 only sends x and y coordinates when clicked, not longer the name/value of the element 2 1.0 1.0
Feature Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Базовая поддержка {{CompatVersionUnknown}} {{CompatGeckoMobile("2.0")}} {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}}
type {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}}
type=image {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}}

 

Смотри также