Location pathname Property
Definition and Usage
The pathname property sets or returns the pathname of a URL.
Browser Support
| Property | |||||
|---|---|---|---|---|---|
| pathname | Yes | Yes | Yes | Yes | Yes |
Syntax
Return the pathname property:
location.pathname
Set the pathname property:
location.pathname = path
Property Values
| Value | Type | Description |
|---|---|---|
| path | String | Specifies the pathname of the URL |
Technical Details
| Return Value: | A String, representing the pathname |
|---|
❮ Location Object

