Link to home
Start Free TrialLog in
Avatar of kheim2008
kheim2008Flag for Poland

asked on

dynamic style change from events binded by java script

Hi,

When I use below code it's not working - can you please tell me why?

It work well when I put onmouseover and onmouseout directly in <TR> element

Thanks!
<table>
  <tr id='mytr'>
    <td>Hello World</td>
  </tr>
</table>
 
<script language='javascript'>
var
  e = document.getElementById("mytr");
    
  e.onmouseover="this.style.background='blue'";
  e.onmouseout="this.style.background='white'";
</script>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of alien109
alien109
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial