ในการรับส่วนชื่อพาธของแอตทริบิวต์ href ของพื้นที่ใน JavaScript ให้ใช้คุณสมบัติชื่อพาธ
ตัวอย่าง
คุณสามารถลองเรียกใช้รหัสต่อไปนี้เพื่อแสดงส่วนชื่อพาธ
<!DOCTYPE html>
<html>
<body>
<img src = "/images/html.gif" alt = "HTML Map" border = "0" usemap = "#html"/>
<map name = "html">
<area id="myarea" shape = "circle" coords = "154,150,59" href = "about.htm" target = "_self" >
</map>
<script>
var x = document.getElementById("myarea").pathname;
document.write("<br>Pathname: "+x);
</script>
</body>
</html>