whats the simplest way to return the "pathname" from an anchor tags href attribute?
example... say I have:
<a href="http://www.example.com/this/is/my/path.html">Blah</a>
I need to return only this "/this/is/my/path.html" part.
Ideas? I'm using jQuery if it helps..
Thanks!
see working example here.. http://jsfiddle.net/TvNmL/
HTML..
<a id='lnk' href="http://www.example.com/this/is/my/path.html">Blah</a>
javascript...
alert( document.getElementById('lnk').pathname);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With