HTML - <input type="image">
The <input type="image">
is a graphical submit button. You must use the src attribute to define the source of the image and the alt attribute to define alternative text. The height and width attributes are used to define the size of the image in pixels.
Description
The <input type="image">
is a graphical submit button. You must use the src attribute to define the source of the image and the alt attribute to define alternative text. The height and width attributes are used to define the size of the image in pixels.
Permitted content | None, it is an empty element. |
---|---|
Tag omission | Must have a start tag and must not have an end tag. |
Permitted parent elements | Any element that accepts phrasing content. |
DOM interface | HTMLInputElement |
Attributes
Includes the Global Attributes.
Name | Version | Description |
---|---|---|
formaction |
HTML5 | The URI of a program that processes the information submitted by the input element, here image if specified, it overrides the action attribute of the element's form owner. |
formenctype |
HTML5 | 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 |
formmethod |
HTML5 | 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 |
formnovalidate |
HTML5 | This Boolean attribute specifies that the form is not to be validated when it is submitted. If this attribute is specified, it overrides the novalidate attribute of the element's form owner. |
formtarget |
HTML5 | 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 target attribute of the element's form owner. The following keywords have special meanings:
|
height |
HTML5 | This attribute defines the height of the image displayed for the button. |
required |
HTML5 | 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 :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 |
HTML 4 | The name of a <map> element as an image map. |
width |
HTML5 | This attribute defines the width of the image displayed for the button. |
?? |
Browser Compatibility
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|
Basic support | 1.0 | 1.0 (1.7 or earlier) | 2 or earlier | 1.0 | 1.0 |
type | 1.0 | 1.0 (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 |
---|---|---|---|---|---|
Basic support | (Yes) | 4.0 (2.0) | (Yes) | (Yes) | (Yes) |
type | (Yes) | (Yes) | (Yes) | (Yes) | (Yes) |
type=image | (Yes) | (Yes) | (Yes) | (Yes) | (Yes) |
-
See also
Specifications
Specification | Status |
---|---|
WHATWG HTML Living Standard The definition of '<input type="image">' in that specification. |
Living Standard |
HTML5 The definition of '<input type="image">' in that specification. |
Recommendation |
HTML 4.01 Specification The definition of '<form>' in that specification. |
Recommendation |
License
© 2016 Mozilla Contributors
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-us/docs/web/html/element/input/image