The current URL in jQuery can be obtained by using the ‘href’ property of the Location object which contains information about the current URL. The ‘href’ property returns a string with the full URL of the current page.
Before clicking the button:
After clicking the button:
- How to get the size of screen, current web page and browser window using jQuery?
- How to get title of current HTML page using jQuery ?
- How to get the path of current script using Node.js ?
- Get current timestamp using Python
- Program to get the subdomain of a URL using PHP
- How to get current function name in PHP?
- How to get the current date and time in seconds?
- How to Get the Current Working Directory in Golang?
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.