Open In App

What is the use of ismap Attribute in <img> Tags ?

Last Updated : 23 Feb, 2024
Improve
Improve
Like Article
Like
Save
Share
Report

The ismap attribute in <img> tags is used to specify an image as a server-side image map. This attribute indicates that the image should be treated as an image map, allowing clickable regions within the image to be defined by server-side scripting.

Syntax

<img src="image.jpg" ismap>
  • "image.jpg" is the URL of the image file.
Key Point Description
Server-side Image Map The ismap attribute indicates that the image should be treated as a server-side image map, with clickable regions defined by server-side scripting.
Clickable Regions Server-side scripting is used to define clickable regions within the image, allowing users to interact with specific areas of the image.
Compatibility While still supported in some browsers, server-side image maps have become less common with the rise of client-side image maps using the “usemap” attribute.
Accessibility Care should be taken when using server-side image maps to ensure accessibility for users with disabilities, including providing alternative text and keyboard navigation options.

Features

  • Basic Usage: Add the “ismap” attribute to the <img> tag to indicate that the image should be treated as a server-side image map.
  • Clickable Regions: Define clickable regions within the image using server-side scripting, such as CGI scripts or server-side languages like PHP, to process user interactions and responses.
  • Alternative Approach: While server-side image maps using “ismap” are still supported, client-side image maps using the “usemap” attribute combined with an associated <map> element have become more common due to their greater flexibility and ease of implementation.

Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads