Edit This Code:
See Result »
<!DOCTYPE html> <html> <body> <p>Click the button to display the URL of the document.</p> <button onclick="myFunction()">Try it</button> <p id="demo"></p> <script> function myFunction() { var x = document.URL; document.getElementById("demo").innerHTML = x; } </script> </body> </html>
Result: