XHTML » input » type="image"

The type="image" control allows you to use a graphic image or a picture as the equivalent of a type="submit" button. For example, you could create your own submit gif. Indeed, the specified image will perform exactly as a submit button, when you click the image, the form is submitted.

The type="image" also allows you to display a mouse-sensitive image map within a form. (This requires that the browser be able to capture and process the X/Y coordinates of the mouse.)

You must use the src attribute to list the location of the image file. You can use the alt attribute to provide text for browsers that cannot display an image. Some browsers, by default, place a border around the image.


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<title>DevGuru XHTML input Tag Example</title>
<input type="image" src="/images/submit.gif" onclick="submitform()" name="submitgif" />
Language(s): HTML