Location pathname property
Definition and Usage
pathname attribute is a readable and writable string sets or returns the path portion of the current URL.
grammar
location.pathname
Browser Support
All major browsers support pathname property
Examples
Examples
Returns the name of the current path of the URL:
<script>
document.write(location.pathname);
</script>
document.write(location.pathname);
</script>
Examples of the above output:
try it"
Location Object