- A link colors can be accessed using the document object
- document.alinkColor = "#FFCC33"
- document.linkColor = "#FFCC33"
- document.vlinkColor = "#FFCC33"
- You can refer to all the links on your page with a reference to the document
document.links[n] (a number or the name of that link is inserted in the square
brackets)
- You can refer to your anchors the same way
document.anchors[n] (a number or the name of that link is inserted in the square
brackets)
- You can refer to the hash close to the same way (the hash is the part that
follows the # in your anchor)
document.links[n].hash = "targetname"
- You can refer to the host close to the same way (that is a combination of
the host name and the port of the destination server.)
document.links[n].host = "www.enetopia.com:80"
- You can refer to the host name close to the same way
document.links[n].hostname = "www.enetopia.com"
- You can refer to the href close to the same way
document.links[n].href = "http://www.enetopia.com"
- You can refer to the path attribute close to the same way (that's the part
that doesn't have the server name or port in it
document.links[n].path = "/images/newest/myPict.gif"
- You can refer to the port attribute close to the same way
document.links[n].port = "enetopia"
- You can refer to the protocol attribute close to the same way
document.links[n].protocol = "http:"
various protocols are: http, ftp, file, mailto, or https
- You can refer to the search attribute close to the same way (that's the
part that is after the ? character.) Using the ? is a way to transfer information
besides just the URL.
document.links[n].search = "?name=Gail&platform=ie6"
- You can refer to the target attribute close to the same way. (The "_top"
designation automatically assigns the link the top of the frame, so we are
no longer inside a frame)
document.links[n].target = "_top"