Javascript examples for DOM HTML Element:Anchor
Get pathname from href in anchor element in Javascript
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=( function() {//w w w. java2 s . c om console.log( document.getElementById('lnk').pathname); }); </script> </head> <body> <a id="lnk" href="http://www.example.com/this/is/my/path.html">Blah</a> </body> </html>