Question: what is my url in javascript?
Answer: Answer: Use the window. location. href Property You can use the JavaScript window. location. href property to get the entire URL of the current page which includes host name, query string, fragment identifier, etc. The following example will display the current url of the page on click of the button.