Sometimes you may need to show the URL address in website. Is it possible? Yes! With a simple one line JavaScript code, you can do it. Your visitor may print the webpage, and you may want the URL to be printed in specific part of the webpage - and that's why this code is useful.



Whats' the URL of this webpage? 





SourceCode

<script>
document.write('<center>'+window.location+'</center>')
</script>



Just copy this code and paste inside your code where you want to show the URL of that specific webpage. Note that, if you want to show without alignment, just remove center tag like this below.



<script>
document.write(window.location)
</script>