运行 ❯
获取您的
自己的
网站
×
更改方向
保存代码
更改主题,深色/浅色
前往 Spaces
<!DOCTYPE html> <html> <body> <img id="planets" src="planets.gif" width="145" height="126"> <map name="planetmap"> <area id="venus" shape="circle" coords="124,58,8" alt="The planet venus" href="venus.htm"> </map> <p id="demo">It is not possible to click on the "venus" area in the image-map, because the the image does not have a usemap.</p> <p>Click the button to set the value of the usemap attribute of the image to "#planetmap".</p> <button onclick="myFunction()">Try it</button> <script> function myFunction() { var x = document.getElementById("planets").useMap = "#planetmap"; document.getElementById("demo").innerHTML = "The usemap is set, and the venus link now works!"; } </script> </body> </html>