Javascript examples for DOM HTML Element:Area
Area host Property - Change the hostname and port number 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="venus.htm#description"> </map>//from w w w . j a v a 2 s . c o m <button onclick="myFunction()">change the hostname and port number of the href attribute value for the "myId" area in the image-map</button> <p id="demo"></p> <script> function myFunction() { document.getElementById("myId").host = "www.example.com:300"; document.getElementById("demo").innerHTML = "The hostname and port was changed from 'www.java2s.com:80' to 'www.example.com:300'."; } </script> </body> </html>