Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title></title>
<script type="text/javascript">
/*<![CDATA[*/
function HighLight(cls,txt){
var cells=zxcByClassName(cls)
for (var td,z0=0;z0<cells.length;z0++){
td=cells[z0];
while (td.parentNode&&td.nodeName.toUpperCase()!='TD'){
td=td.parentNode;
}
if (td.nodeName.toUpperCase()=='TD'){
td.style.backgroundColor=cells[z0].innerHTML!=txt?'red':'blue';
}
}
}
function zxcByClassName(nme,el,tag){
if (typeof(el)=='string') el=document.getElementById(el);
el=el||document;
for (var tag=tag||'*',reg=new RegExp('\\b'+nme+'\\b'),els=el.getElementsByTagName(tag),ary=[],z0=0; z0<els.length;z0++){
if(reg.test(els[z0].className)) ary.push(els[z0]);
}
return ary;
}
/*]]>*/
</script>
</head>
<body>
<table border="1">
<tr>
<td><span class="name" >Name 1</span></td>
<td><span class="name" >Name 2</span></td>
<td><span class="name" >Name 3</span></td>
<td><span class="name" >Name 4</span></td>
</tr>
<tr>
<td><span class="name" >Name 1</span></td>
<td><span class="name" >Name 2</span></td>
<td><span class="name" >Name 3</span></td>
<td><span class="name" >Name 4</span></td>
</tr>
<tr>
<td><span class="name" >Name 1</span></td>
<td><span class="name" >Name 2</span></td>
<td><span class="name" >Name 3</span></td>
<td><span class="name" >Name 4</span></td>
</tr>
<tr>
<td><span class="name" >Name 1</span></td>
<td><span class="name" >Name 2</span></td>
<td><span class="name" >Name 3</span></td>
<td><span class="name" >Name 4</span></td>
</tr>
</table>
<table border="1" onmouseout="HighLight('name','???');">
<tr>
<td class="mse" onmouseover="HighLight('name','Name 1');" >Name 1</td>
</tr>
<tr>
<td class="mse" onmouseover="HighLight('name','Name 2');" >Name 2</td>
</tr>
<tr>
<td class="mse" onmouseover="HighLight('name','Name 3');" >Name 2</td>
</tr>
<tr>
<td class="mse" onmouseover="HighLight('name','Name 4');" >Name 4</td>
</tr>
</table>
</body>
</html>
Bookmarks