HTML DOM Area port property
Definition and Usage
port property sets or returns the href attribute worth port section.
grammar
areaObject.port=port
Browser Support
All major browsers support port property
Tips and Notes
Note: If the URL port has not been specified, or 80 (the default value), some browsers will display zero or nothing is displayed.
Examples
Examples
The following example returns "Venus" in the port area:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>本教程(w3big.com)</title>
</head>
<body>
<img src="planets.gif" 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>
<html>
<head>
<meta charset="utf-8">
<title>本教程(w3big.com)</title>
</head>
<body>
<img src="planets.gif" 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>
Examples of the above output:
port "Venus" area: 80
try it"
Area objects