The cover of The Complete Idiot's Guide to Create a Web Page The Complete Idiot's HTML Tag Reference

| Index | Previous Tag: <INPUT> (HIDDEN) | Next Tag: <INPUT> (PASSWORD) |


<INPUT> (IMAGE)

Creates an image control that the user can click to submit a form.

Support:

HTML StandardInternet ExplorerNetscape Navigator
2.0 and later 1.0 and later 1.0 and later
Notes:
  • This type of button acts just like a SUBMIT INPUT button. That is, when the user clicks the image, the form is submitted to the server.
  • When the user clicks the image, the browser sends not only the form data, but also the coordinates, in pixels, of the spot on the image where the user clicked. These are sent as "x" (the horizontal coordinate) and "y" (the vertical coordinate).
Attributes:
ACCESSKEY = "Text (single character)"
A character to use as a keyboard shortcut for selecting the control.

Support:

HTML StandardInternet ExplorerNetscape Navigator
4.0 and later 4.0 and later Not supported

Notes:

  • The access key is invoked by using it as a key combination. For example, if you specify ACCESSKEY="P", then the user invokes the key by pressing Alt+P (Windows) or Cmd+P (Mac).

ALIGN = "Text"
The alignment of text that follows the image.

Support:

HTML StandardInternet ExplorerNetscape Navigator
2.0 and later 1.0 and later 1.0 and later

Notes:

  • Possible values: LEFT, RIGHT, TOP, TEXTTOP, MIDDLE, TEXTMIDDLE, BASELINE, BOTTOM, TEXTBOTTOM.
  • This attribute is deprecated.

ALT = "Text"
Text to display for browsers that don't support (or are configured not to display) images.

Support:

HTML StandardInternet ExplorerNetscape Navigator
4.0 and later 4.0 and later Not supported

Notes:

  • Most modern browsers also use the ALT text to display a banner above the image when the user hovers their mouse over the image.

BORDER = Postive integer
The thickness of the border that surrounds the image.

Support:

HTML StandardInternet ExplorerNetscape Navigator
Not supported Not supported 1.0 and later

CLASS = "Text"
The style sheet class used by the tag.

Support:

HTML StandardInternet ExplorerNetscape Navigator
4.0 and later 4.0 and later 4.0 and later

Notes:

  • You can specify two or more classes; be sure to separate each class name with a space.

DISABLED
Prevents the user from being able to select the control.

Support:

HTML StandardInternet ExplorerNetscape Navigator
3.0 and later 4.0 and later Not supported

HEIGHT = Positive integer
The image's height, in pixels.

Support:

HTML StandardInternet ExplorerNetscape Navigator
Not supported 4.0 and later 1.1 and later

ID = "Text"
An alphanumeric string that uniquely identifies the tag.

Support:

HTML StandardInternet ExplorerNetscape Navigator
4.0 and later 4.0 and later 4.0 and later

Notes:

  • Although you can use letters and numbers for the ID, the first character must be a letter.

LANG = "Text"
The language used by the tag's attribute values and text content.

Support:

HTML StandardInternet ExplorerNetscape Navigator
4.0 and later 4.0 and later Not supported

NAME = "Text"
The name of the control.

Support:

HTML StandardInternet ExplorerNetscape Navigator
2.0 and later 1.0 and later 1.0 and later

Notes:

  • The NAME attribute enables scripts to work with this control.
  • With the exception of the RADIO control, all form elements must have a unique name.

SRC = "Text"
The URL of the image.

Support:

HTML StandardInternet ExplorerNetscape Navigator
2.0 and later 1.0 and later 1.0 and later

Notes:

  • Use either just a file name (if the image file is in the same directory as the page), a relative name (if the image file is in another directory), or a full URL.

STYLE = "Text"
The style or styles to use with the tag.

Support:

HTML StandardInternet ExplorerNetscape Navigator
4.0 and later 4.0 and later 4.0 and later

Notes:

  • If you enter multiple style properties, separate each one with a semi-colon (;).

TABINDEX = Positive integer
The control's position with the page's tabbing order.

Support:

HTML StandardInternet ExplorerNetscape Navigator
4.0 and later 4.0 and later Not supported

Notes:

  • The "tabbing order" is the order in which page elements are selected when the user presses the Tab key.

TYPE = "Text"
The type of the INPUT tag.

Support:

HTML StandardInternet ExplorerNetscape Navigator
2.0 and later 1.0 and later 1.0 and later

Notes:

  • Use TYPE=IMAGE.

USEMAP = "Text"
The image map coordinates (as specified by a <MAP> tag) to use with the image.

Support:

HTML StandardInternet ExplorerNetscape Navigator
4.0 and later Not supported 2.0 and later

Notes:

  • The value of this attribute is the name of the image map (given by the <MAP> tag's NAME attribute), preceded by a number sign (#).

VALUE = "Text"
The initial value assigned to the control.

Support:

HTML StandardInternet ExplorerNetscape Navigator
2.0 and later Not supported Not supported

WIDTH = Positive integer
The image's width, in pixels.

Support:

HTML StandardInternet ExplorerNetscape Navigator
Not supported 4.0 and later 1.1 and later

Example:
<FORM ACTION="http://www.mcfedries.com/cgi-win/formtest.exe" METHOD=POST>
Enter a URL:<BR>
<INPUT TYPE=TEXT NAME="url" VALUE="http://"><BR>
<INPUT TYPE=IMAGE SRC="addurl.gif">
</FORM>
How It Looks:
Enter a URL:



| Index | Previous Tag: <INPUT> (HIDDEN) | Next Tag: <INPUT> (PASSWORD) |