...

View Full Version : onmouseout class



spadi33
06-11-2008, 12:14 PM
Hello,

I got this javascript:


function stada(ah)
{
var ele = document.getElementById(ah);
for(x = 0; x < ele.rows.length; x++)
{
ele.rows[x].className = 'ah';
if (x%2 == 0)
{
ele.rows[x].className = 'ah1';
}
eelse
{
ele.rows[x].className = 'ah2';
}
}
}
window.onload = function(){
stada('ah_table1');
stada('ah_table2');
}

It puts separate classNames on every other row in a table.

I want to use:


<table id="ah_table1">
<tr onmouseover="this.className='ah3'" onmouseout="this.className=''">
<td>Hello</td>
</tr>
</tabl>

But am unable to figure out how to have onmouseout go back to the original class as was before onmouseover.

Any ideas?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum