0 votes
in JavaScript by
What are the various url properties of location object in Javascript?

1 Answer

0 votes
by

The below Location object properties can be used to access URL components of the page,

  1. href - The entire URL
  2. protocol - The protocol of the URL
  3. host - The hostname and port of the URL
  4. hostname - The hostname of the URL
  5. port - The port number in the URL
  6. pathname - The path name of the URL
  7. search - The query portion of the URL
  8. hash - The anchor portion of the URL
...