Is there a flaw in this script
<body onload="makeMemory()">
For some reason the script doesn't seem to work. Is there an error in it?
<script type="text/javascript">
var lastClickedLink = null;
function rememberLink() {
if (lastClickedLink) {lastClickedLink.style.color = "";}
lastClickedLink = this;
this.style.color = "red";
}
function makeMemory() {
for (var i=0; i<document.links.length; i++) {
var link = document.links[i];
if (link.addEventListener) {
link.addEventListener("click",rememberLink,false);
} else if (link.attachEvent) {
link.attachEvent("onclick",rememberLink);
} else {
link.onclick=rememberLink;
}
}
}
<script> -
wayfarer -
[ 1 ] Thanks
SignatureI build web things, server things. I help build the startup Veenome. | Remote Programming Jobs{{ DiscussionBoard.errors[10758350].message }} -