Javascript examples for DOM HTML Element:Area
Area pathname Property - Change the path name of the URL for 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="http://www.example.com/test.htm"> </map>/* www .j a v a2 s .c o m*/ <button onclick="myFunction()">change the path name of the href attribute</button> <p id="demo"></p> <script> function myFunction() { document.getElementById("myId").pathname = "somenewpathname"; document.getElementById("demo").innerHTML = "The pathname was changed from 'test' to 'somenewpathname'"; } </script> </body> </html>