You are here: Reference > JavaScript > client-side > HTML DOM > properties > isMap (img)

isMap property (img)

Browser support:
Sets or retrieves a Boolean value that indicates whether an img is a server-side or client-side image map.
With this property you can submit the coordinates of a user click on an img to a server.
Place the img element in an anchor tag and set the href property of the anchor tag to the URL of the server. In that case, if the img is a server-side image map, when the user clicks on the image, the URL specified by the href property will be called with the coordinates of the mouse click. The coordinates are relative to the top-left corner of the image.
The coordinates are appended to the end of the URL in the following form: URL?x,y, where x and y are the coordinates of the click.

Syntax:

object.isMap;
You can find the related objects in the Supported by objects section below.
This property is read/write.
HTML page for this property: ISMAP

Possible values:

Boolean that indicates whether the img is an image map.
One of the following values:
false
Default. The img is a client-side image map.
true
The img is a server-side image map.
Default: false.

Example HTML code 1:

This example illustrates the use of the ISMAP attribute:
Move the mouse over the image, and watch the statusbar.<br />
Click on the image, and watch the location bar.<br />
<a href="#">
    <img src="picture.gif" ismap="ismap" />
</a>
Did you find this example helpful? yes no

Example HTML code 2:

This example illustrates the use of the ISMAP property:
<head>
    <script type="text/javascript">
        function ToggleMapping () {
            var image = document.getElementById ("myImage");
            image.isMap = !image.isMap;
        }
    </script>
</head>
<body>
    Move the mouse over the image, and watch the statusbar.<br />
    Click on the image, and watch the location bar.<br />
    <a href="#">
        <img id="myImage" src="picture.gif" ismap="ismap" />
    </a>

    <button onclick="ToggleMapping ();">Change isMap property!</button>
</body>
Did you find this example helpful? yes no

Supported by objects:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content