Code Premix

window.location.href

📅July 24, 2021

The window.location read-only property returns a location object with information about the current location of the document.

Example: window.location.href

This method returns the URL of the current page.

console.log(window.location.href);

// Output: https://codepremix.com/window-location-href

That’s it in this #quick KB.
Thank you for reading. Happy Coding..!!