Javascript examples for DOM HTML Element:Area
Area hash Property - Change the anchor part of a specific area in an image-map:
<!DOCTYPE html> <html> <body> <img src="http://java2s.com/resources/a.png" width="145" height="126" usemap="#myMap"> <map name="myMap"> <area id="myId" target="_blank" shape="circle" coords="125,60,10" alt="Venus" href="venus.htm#description"> </map>//from www. j a v a 2s .com <button onclick="myFunction()">change the anchor part of the href attribute for the "myId" area in the image-map</button> <p id="demo"></p> <script> function myFunction() { document.getElementById("myId").hash = "newhashvalue"; document.getElementById("demo").innerHTML = "The anchor part was changed from 'description' to 'newhashvalue'."; } </script> </body> </html>