Computer >> Computer tutorials >  >> Programming >> Javascript

How to Get the current Page URL with JavaScript

To get the current web page URL of your browser you need to grab the window.location.href property.

Type the following code in your browser console and hit enter:


var currentURL = window.location.href;

currentURL();
How to Get the current Page URL with JavaScript