type=image

FilterElements

HTML: <input type="image">
XHTML: <input type="image"/>  or  <input type="image" />

Allows an image to be used as a substitute for a submit button. If a type="image" button is pressed, the form is submitted.

Start/End Tags

This is an empty element. In HTML, the end tag is forbidden. In XHTML, the element must be closed with a trailing slash as just shown. Developers may include a space character before the slash for backward compatibility with older browsers.

Specifications

  • HTML 4.01
  • HTML5

align=

Values: bottom | left | middle | right | top
Deprecated. Not in HTML5. Specifies the alignment of an image.

alt=

Values: text
Specifies alternative text for an image used as a button.

autofocus

Values: None in HTML. (autofocus="autofocus" in XHTML)
HTML5 only. Indicates the control should have focus (be highlighted and ready for user input) when the document loads.

disabled

Values: None in HTML. (disabled="disabled" in XHTML)
Disables the control for user input. It can be altered only via a script. Browsers may display disabled controls differently (grayed out, for example), which could be useful for dimming certain controls until required info is supplied.

form=

Values: id of the form owner
HTML5 only. Explicitly associates the input control with its associated form (its form owner). With this method, the input control does not need to be a child of the applicable form element.

formaction=

Values: URL
HTML5 only. Specifies the application that will process the form. It is used only with a submit button (type="submit" or "image") and has the same function as the action attribute for the form element.

formenctype=

Values: content type
HTML5 only. Specifies how the form values are encoded with the post method type. It is used only with a submit button (type="submit" or "image") and has the same function as the enctype attribute for the form element. The default is Internet Media Type (application/x-www-form-urlencoded). The value multipart/form-data should be used in combination with the file input type.

formmethod=

Values: get | post | put | delete
HTML5 only. Specifies which HTTP method will be used to submit the form data. It is used only with a submit button (type="submit" or "image") and has the same function as the method attribute for the form element. The put and delete values are new in HTML5.

formnovalidate

Values: None in HTML. (formnovalidate= formnovalidate  in XHTML5)
HTML5 only. Indicates that the form is not to be validated during submission. It is used only with a submit button (type="submit" or "image") and has the same function as the novalidate attribute for the form element (new in HTML5).

formtarget=

Values: name
HTML5 only. Specifies the target window for the form results. It is used only with a submit button (type="submit" or "image") and has the same function as the target attribute for the form element.

height=

Values: number of pixels
HTML5 only. Specifies the height of the button image when the input type is set to image.

ismap

Values: None in HTML. (ismap="ismap" in XHTML)
Not in HTML5. Indicates that the graphic is used as the basis for a server-side image map (an image containing multiple hypertext links). This attribute may be used with the “image” input type only.

name=

Values: text
Required. Assigns a name to the control; a script program uses this name to reference the control.

src=

Values: URL
When the input type is image, this attribute provides the location of the image to be used as a push button.

usemap=

Values: URL
Not in HTML5. Specifies the map containing coordinates and links for a client-side image map (an image containing multiple hypertext links). This attribute may be used with the “image” input type only.

width=

Values: number of pixels
HTML5 only. Specifies the width of the bottom image when the input type is set to image.

HTML 4.01 <input> Events

onchange
Occurs when the element loses the input focus and its value has been modified since gaining focus
<input type="image" src="graphics/sendme.png" alt="Send me">

Rendered Example