สถานที่ให้บริการกัญชา HTML DOM พื้นที่
ความหมายและการใช้งาน
การตั้งค่าคุณสมบัติกรัมกัญชาหรือผลตอบแทนส่วนที่ยึดเหนี่ยวของมูลค่าแอตทริบิวต์ href
ไวยากรณ์
areaObject.hash=anchorname
สนับสนุนเบราว์เซอร์
เบราว์เซอร์ที่สำคัญทั้งหมดสนับสนุนคุณสมบัติกัญชา
ตัวอย่าง
ตัวอย่าง
ตัวอย่างต่อไปนี้จะส่งกลับ "วีนัส" พื้นที่สมอส่วนของแอตทริบิวต์ href:
<!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#description">
</map>
<p>金星href属性的锚:
<script>
document.write(document.getElementById("venus").hash);
</script>
</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#description">
</map>
<p>金星href属性的锚:
<script>
document.write(document.getElementById("venus").hash);
</script>
</p>
</body>
</html>
ตัวอย่างของการส่งออกดังกล่าวข้างต้น:
金星href属性的锚: #description
ลอง»
วัตถุใกล้เคียง