The pathname property represents the pathname portion of the link URL.
<html>
<head>
<title> Using the pathname property of the Link object</title>
</head>
<body>
<script language="JavaScript">
<!--
function showpathname(){
alert(document.links[0].pathname);
}
-->
</script>
Click the button to see the pathname for the URL
<form name="form1">
<a href=http://www.java2s.com>
http://www.java2s.com</a>
<br><br>
<input type="button" name="path" value="Get Pathname Value" onClick='showpathname()'>
<br>
</form>
</body>
</html>