Get your own website Result Size: 625 x 565
x
 
<!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.html">
  <area id="myArea" shape="circle" coords="90,58,3" alt="Mercury" href="mercur.html">
  <area shape="circle" coords="124,58,8" alt="Venus" href="venus.html">
</map>
<p>Click the button to get the URL of the area element with id="myArea" in the image-map.</p>
<button onclick="myFunction()">Try it</button>
<p id="demo"></p>
<script>
function myFunction() {
  var x = document.getElementById("planetmap").areas.namedItem("myArea").href;
  document.getElementById("demo").innerHTML = x;
}
</script>
</body>
<!-- Mirrored from www.w3schools.com/jsref/tryit.asp?filename=tryjsref_map_areas_nameditem by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 21 Dec 2022 18:16:59 GMT -->
</html>