Skip to content
Related Articles

Related Articles

Improve Article

HTML DOM Object useMap Property

  • Last Updated : 14 Jul, 2021

The HTML DOM Object useMap Property is used to set or return the value of the usemap attribute of an <object> element. The <object> usemap attribute is used to specify the name of an image-map to use with the object. The image with clickable areas is called an image map. The useMap attribute is related to the association with the <map> element’s name attribute and creates a relationship between the object and map. 


  • It is used to return the useMap Property.
  • It is used to set the useMap Property.
objObject.useMap = #mapname

Property Values 

  • #mapname: It is used to hold the map name containing the hash (#) character.

Return Values: It returns a string value that represents the value of the usemap attribute of an <object> element if it contains the hash character (“#”).


Example 1: The below code returns a useMap property.


<!DOCTYPE html>
<body style="text-align: center">
    <h2>HTML Dom Object useMap Property</h2>
    <object id="mygeeks" data=
    <button onclick="GFG()">
        Click Here!
    <map name="Geeks1">
        <area id="Geeks" shape="rect" 
            coords="0, 0, 110, 100" alt="Geeks">
    <p id="GEEK!"></p>
        function GFG() {
            // Return value of usemap attribute
            var x = document.getElementById("mygeeks").useMap;
            document.getElementById("GEEK!").innerHTML = x;


Supported Browsers:

  • Google Chrome
  • Microsoft Edge
  • Firefox
  • Opera
  • Safari

Attention reader! Don’t stop learning now. Get hold of all the important HTML concepts with the Web Design for Beginners | HTML  course.

My Personal Notes arrow_drop_up
Recommended Articles
Page :