TUTORIAL前端与浏览器FETCHED
Area protocol 属性
Area protocol 属性 Area 对象 定义和用法 protocol 属性可设置或者返回 href属性值的协议部分。 语法 areaObject.protocol=protocol 浏览器支持 所有主要浏览器都支持 protocol 属性 实例 实例 下面的例子可返回 'Venus' 区域中的协议: [mycode2] 菜鸟教程(runoob.com) 金星区域的..
更新于 2026/7/16
教程详情页默认 noindex。
Area protocol 属性
Area 对象
定义和用法
protocol 属性可设置或者返回 href属性值的协议部分。
语法
areaObject.protocol=protocol
浏览器支持
![]()
![]()
![]()
![]()
![]()
所有主要浏览器都支持 protocol 属性
实例
实例
下面的例子可返回 "Venus" 区域中的协议:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>菜鸟教程(runoob.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>金星区域的 protocol:
<script>
document.write(document.getElementById('venus').protocol);
</script>
</p>
</body>
</html>
<html>
<head>
<meta charset="utf-8">
<title>菜鸟教程(runoob.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>金星区域的 protocol:
<script>
document.write(document.getElementById('venus').protocol);
</script>
</p>
</body>
</html>
以上实例输出结果:
金星区域的 protocol: http:
尝试一下 »
Area 对象