--- 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")}}
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 {{HTMLElement("input")}} element with the {{htmlattrxref("type","input")}} attribute set to file
.text/plain
If this attribute is specified, it overrides the {{htmlattrxref("enctype","form")}} attribute of the element's form owner.
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 the form 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 the {{htmlattrxref("method","form")}} attribute of the element's form owner.
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
.image
type (submit
, reset
, or button
). The {{cssxref(":optional")}} and {{cssxref(":required")}} CSS pseudo-classes will be applied to the field as appropriate.<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}} |