What is the href property?
Are you preparing for IT certification? With practice questions, study notes, interactive quizzes, tips and technical articles, uCertify PrepKits ensure that you get a solid grasp of core technical concepts to ace your certification exam in first attempt.
What is the href property?
Rating:
The href property belongs to the location object. The full form of href is hypertext reference. This property is used to set or retrieve the entire URL of a document that is opened in a window or frame.
The syntax of using the href property is as follows:
The entire URL includes the following:
- protocol
- hostname
- port (if available)
- hash (if available)
- pathname (path of a directory or file separated by slash)
For example:
In the above URL, the href property includes the following:
- protocol: http:
- hostname: www.yahoo.com
- pathname: /index.html
Rating:
Was this information helpful?
Other articles
- How to delete a cookie?
- What is the write method?
- What is the status property?
- Functions, Global Functions, and Custom Objects.
- What is the pathname property?