The type attribute is required.This is no longer necessary, and will break your script in XHTML pages.
Code:
document.getElementById(number).innerHTML = " " + text;
innerHTML is non-standard and has several practical issues.
Code:
<a href="yoursite" onmouseover="display('the text to display','1')" onmouseout="undo('1')">yoursite</a><font color="black" id='1'> </font>
The <font> tag is not valid HTML Strict. IDs may not start with a number.
Wouldn't it make more sense to use the same element for all links? You're never going to have more than one description up at a time, after all. You could make it less obtrusive, too:
Code:
<script type="text/javascript">
onload = function() {
var m, i, a, as,
mo = function() {
document.getElementById("descr").firstChild.nodeValue = "";
};
if(!(m = document.getElementById("descr"))
(m = document.body.appendChild(
document.createElement("p")
)).id = "descr";
if(!m.firstChild)
m.appendChild(document.createTextNode(""));
for(i = 0, as = document.links, a = as[0]; i < a.length; a = as[++i])
if(m = a.className.match(/describe\(([^\)]+)\)/) {
a.onmouseover = (function(d) {
return function() {
document.getElementById("descr").firstChild.nodeValue = d;
};
})(m[1]);
a.onmouseout = mo;
}
};
</script>
Then:
Code:
<span id="descr"></span>
And:
Code:
<a href="somepage.html" class="describe(Some page or other.)">Some Page</a>
Bookmarks