Page 1 of 1

change background of table onmouseover

Posted: Wed Jun 24, 2009 1:55 am
by dheeraj
hello i guys i know hw to change a color of a cell on any event, bt not getting the way to chage table bgcolor on any event so plz anyone help me ...


Thanks..
Dheeraj

Re: change background of table onmouseover

Posted: Wed Jun 24, 2009 12:31 pm
by Reviresco

Code: Select all

<table id="the_table">
 <tr>
  <td>
  Test<br />test <br />
  test test test test test
  </td>
 </tr>
</table>
<p>
<a href="/" onmouseover="document.getElementById('the_table').style.backgroundColor = 'orange';">Mouse over this</a>
</p>

Re: change background of table onmouseover

Posted: Fri Jun 26, 2009 10:01 am
by juma929
Hello,

You can do the example above or research changing the className which relates to a class in your stylesheet making your page a little easier to maintain in future.

Thanks.