Javascript examples for DOM HTML Element:Area
Area protocol Property - Change the protocol 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" shape="circle" coords="125,60,10" alt="Venus" href="venus.htm"> </map>//from www . j a v a 2 s. c o m <button onclick="myFunction()">change the protocol of the href attribute</button> <p id="demo"></p> <script> function myFunction() { document.getElementById("myId").protocol = "mailto:"; document.getElementById("demo").innerHTML = "The protocol was changed from 'http://' to 'mailto://'."; } </script> </body> </html>