JavaScript에서 영역의 href 속성의 경로 이름 부분을 얻으려면 경로 이름 속성을 사용하십시오.
예시
다음 코드를 실행하여 경로 이름 부분을 표시할 수 있습니다.
<!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>