JS Coding Questions Logo
JS Coding Questions
#124💼 Interview

What are the various url properties of location object

Advertisement

728x90

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

Advertisement

Responsive Ad
🎯 Practice NowRelated Challenge

JavaScript Coding Exercise 40

Test your knowledge with this interactive coding challenge.

Start Coding

Advertisement

728x90
124of476
What are the various url properties of location object | JSCodingQuestions.com