Area Object
CSGNetwork FREE Source Code, Javascript Source, and Code Snippets!
CSGNetwork Custom Search
     Bookmark and Share
Top Free Apps

Right click this window and select "view source" in order to copy the source for this script.

Link Object (same as Area)

Each link on your page is represented by a corresponding link object in JavaScript, with events and properties as described below. You may also loop through every link on your page via the links collection:

document.links[] //links collection
document.links.length //the number of links on your page


Events Description
onClick Code is executed when user clicks on link. Return false to disable link. Example(s)
onDblClick Code is executed when user double clicks on link.
onMouseDown Code is executed when user holds mouse down over link.
onMouseUp Code is executed when user releases mouse from link.
onMouseOver Code is executed when user moves mouse over link. Example(s).
onMouseOut Code is executed when user moves mouse out of link.


Properties Description

We will use the link "" as basis below to explain the various properties.

hash Specifies the anchor portion of the link. (ie: "section2").
host Specifies the host and domain name of a network host. (ie:
hostname Specifies the hostname portion of the link (ie:
href Specifies the entire link.
pathname Specifies the path name of the link (ie: /good.htm).
port Specifies the port portion of the link.
protocol Specifies the protocol portion of the link (ie: http:).
search Specifies the query portion of the link (ie: ?sort=alpha)
target Specifies the target attribute of the link.



<a href="#" onClick="alert('Welcome to Computer Support Group Online!'); return false">Computer Support Group Online</a>



<a href="" onMouseover="window.status='#1 DHTML site online'; return true", onMouseout="window.status=''">Dynamic Drive</a>

CSGNetwork Glossary

Bookmark and Share
Registered® Trademark™ and Copyright© 1973 - CSG, Computer Support Group, Inc. and CSGNetwork.Com All Rights Reserved