In this article, we will know about getting the Website URL for the current webpage or website. The current URL can be obtained by using the ‘URL’ property of the Document object which contains information about the current URL. The ‘URL’ property returns a string with the full location of the current page, along with containing the string having the HTTP protocol such as ( http://).
Return Value: It returns a string value that represents the full URL of the document.
Example: This example illustrates to get the current URL of the webpage.