The links collection off of the document object consists of all hypertext links in the page, accessible as an array, starting with the first link in the page and moving down and to the right. However, you can also add an identifier for each hypertext link and access it in the array through this identifier.

Each item in the collection is a link object, which has properties of its own. Among these are those similar to what we found with location: host, protocol, port, search, and hash, each of which returns that specific piece of the hypertext link. You can also access the complete link through the href property, and the associated linked object (text) through text. This can be handy if you're pulling links from a document in a web page, into a handy sidebar reference or other functionality such as this.