The isMap
property sets or gets whether an image should be part of a
server-side image-map.
isMap |
Yes | Yes | Yes | Yes | Yes |
Return the isMap property.
var v = imageObject.isMap
Set the isMap property.
imageObject.isMap=true|false
Value | Description |
---|---|
true|false |
|
A Boolean type value, true if the image is part of a server-side image-map, otherwise it returns false.
The following code shows how to Set the isMap property.
<!DOCTYPE html>
<html>
<body>
<a href="demo_form.asp">
<img id="myImg" src="http://java2s.com/style/demo/border.png" alt="test" width="100" height="100">
</a><!--from w ww .j a v a 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 = "set";
}
</script>
</body>
</html>
The code above is rendered as follows:
The following code shows how to check if an image is part of a server-side image-map.
<!DOCTYPE html>
<html>
<body>
<a href="demo_form.asp">
<img id="myImg" src="http://java2s.com/style/demo/border.png" alt="test" width="100" height="100" ismap>
</a><!--from ww w . j av a2 s .c om-->
<button onclick="myFunction()">test</button>
<p id="demo"></p>
<script>
function myFunction() {
var x = document.getElementById("myImg").isMap;
document.getElementById("demo").innerHTML = x;
}
</script>
</body>
</html>
The code above is rendered as follows: