Edit This Code:
<!DOCTYPE html>
<html>
<body>

<img src="planets.gif" width="145" height="126" alt="Planets" usemap="#planetmap">

<map id="planetmap" name="planetmap">
  <area shape="rect" coords="0,0,82,126" alt="Sun" href="sun.htm">
  <area shape="circle" coords="90,58,3" alt="Mercury" href="mercur.htm">
  <area shape="circle" coords="124,58,8" alt="Venus" href="venus.htm">
</map>

<p>Click the button to change the name of the image-map.</p>

<button onclick="myFunction()">Try it</button>

<p id="demo"></p>

<script>
function myFunction() {
    document.getElementById("planetmap").name = "newMapName";
    document.getElementById("demo").innerHTML = "The value of the name attribute was changed from 'planetmap' to 'newMapName'.";
}
</script>

</body>
</html>


Result:
Try it Yourself - © w3schools.com
Privacy Policy