Image isMap Property - Set the isMap property: - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Image

Description

Image isMap Property - Set the isMap property:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<a href="#">
  <img id="myImg" src="http://java2s.com/resources/a.png" alt="java2s.com" width="100" height="132">
</a>//  w ww .ja va  2s  .c  o m

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

<p id="demo"></p>

<script>
function myFunction() {
    document.getElementById("myImg").isMap = true;
    document.getElementById("demo").innerHTML = "The image is now part of a server-side image-map.";
}
</script>

</body>
</html>

Related Tutorials