Learn how to get the current URL with JavaScript.
Read on how to do it in this tutorial: https://www.w3schools.com/howto/howto_js_get_url.asp
Current URL
Use window.location.href
to get the current URL address.
Try it yourself here: https://www.w3schools.com/howto/tryit.asp?filename=tryhow_js_get_url
Read more about the window.location
object in our JavaScript Window Location Tutorial.