|
The Web API URL.pathname property is used to get USVString containing an initial “/” followed by the path of the URL. Syntax: var str = URL.pathname Return Value: This property returns a USVString containing the pathname of the URL. Note: If there is no path set for the URL, so it will Return only /. Example 1: There is no path set for the URL, so it will return only / HTML
Output: Example 2: HTML
Output: Supported Browsers:
|
Reffered: https://www.geeksforgeeks.org
HTML |
Related |
---|
|
|
|
![]() |
![]() |
Type: | Geek |
Category: | Coding |
Sub Category: | Tutorial |
Uploaded by: | Admin |
Views: | 10 |