Area coords Property - Change the coordinates for a specific area in an image-map: - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Area

Description

Area coords Property - Change the coordinates for a specific area in an image-map:

Demo Code

ResultView the demo in separate window

<!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>// w  w w .j  a  v  a  2s .c  om

<button onclick="myFunction()">Test</button>

<script>
function myFunction() {
    document.getElementById("myId").coords = "90,60,5";
    document.getElementById("demo").innerHTML = "changed";
}
</script>

</body>
</html>

Related Tutorials