Javascript examples for DOM HTML Element:Area
Area alt Property - Change the alternate text 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" shape="circle" coords="125,60,10" alt="alt message" href="venus.htm"> </map>// ww w . j ava 2s. com <button onclick="myFunction()">change the alternate text of the "myId" area in the image-map</button> <p id="demo"></p> <script> function myFunction() { document.getElementById("myId").alt = "new message"; document.getElementById("demo").innerHTML = "The value of the alt attribute was changed from 'alt message' to 'new message'."; } </script> </body> </html>