源代碼
點擊運行
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>教程</title> </head> <body> <img src="/images/logo.png" width="145" height="126" usemap="#planetmap"> <map name="planetmap"> <area id="venus" shape="circle" coords="124,58,8" alt="Venus" href="venus.htm"> </map> <p>“金星”區域的port: <script> document.write(document.getElementById('venus').port); </script> </p> <p><b>注意:</b>如果沒有指定端口部分的URL,或者是80(默認),一些瀏覽器會顯示0或什么都沒有。</p> </body> </html>
運行結果