Home >Web Front-end >HTML Tutorial >How to get the value of an image's usemap attribute using JavaScript?
#To get the usemap attribute value of an image, use the useMap attribute. You can try running the following code to display the usemap attribute value -
<!DOCTYPE html> <html> <body> <img id = "myid" src = "/images/html.gif" alt = "HTML Map" usemap = "#html"/> <map name = "html"> <area id = "myarea" shape = "circle" coords = "154,150,59" href = "about.htm" alt = "Team" > </map> <script> var x = document.getElementById("myid").useMap; document.write("<br>Usemap: "+x); </script> </body> </html>
The above is the detailed content of How to get the value of an image's usemap attribute using JavaScript?. For more information, please follow other related articles on the PHP Chinese website!