'pathname' Example : pathname « Javascript Properties « JavaScript Reference

'pathname' Example

    
<html>
<body>
<script language="JavaScript">
    function function1() {
       alert(document.getElementById("myLink").pathname);
    }
</script>
<a id="myLink" href="http://www.java2s.com" target="_blank">java2s.com home page</a>
<input type="Button" id="myB" value="File and path to the page" onClick="function1();">
</body>
</html>

    
      
      








Related examples in the same category

1.'pathname' Syntax and Note
2.'pathname' is applied to