Using scripting, we can change almost any aspect of almost any object at run time. I will show you how to use the srcElement property to detect which page element generated the error and which hyperlink to change. In addition, I will show you how to do this in both VBScript and JavaScript. The secret to making the hyperlink change color is responding to built-in event notifications. Event notifications are continuously sent from Windows to user applications, such as a Web browser.
Events range from mousemove events to timer events and much more.
Linking code to an event notification is very easy. One way to do it is to include code on the hyperlink definition. The code names the event and also names a procedure that should execute when that event occurs. This procedure is included directly in the hyperlink definition. See the sample page listing below.