Get current url angular

    how to get url in html
    how to get url in html javascript
    how to get link in html
    how to get current url in html
  • How to get url in html
  • Html get current url without javascript!

    Get current url nextjs

  • Get current url nextjs
  • Get current url jquery
  • Html get current url without javascript
  • How to get current url in react
  • Javascript get url parameter
  • How to Get the Current URL using JavaScript?

    H

    1. Using Document.URL Property

    The DOM URL property in HTML is used to return a string that contains the complete URL of the current document.

    The string also includes the HTTP protocol such as ( http://).

    Syntax

    document.URL

    Return Value: It returns a string value that represents the full URL of the document. 

    Output

    http://127.0.0.1:5500/index.html

    2.

    Using window.location.href Property

    The window.location.href property of the HTML DOM Window object returns a string containing the URL of the current page. This property is part of the Location object, which contains information about the current location of the document.

    Syntax

    window.location.href

    Output:

    http://127.0.0.1:5500/index.html

    Note: Use the HTML file to copy paste and run the given code and you can see the output in the console, it will print the URL.



      how to get relative url in html
      how to get image url in html