Thursday, 1 March 2012

Changing background colors

<html>
<head>
<script type="text/javascript">
function bgChange(bg)
{
document.body.style.background=bg;
}
</script>
</head>
<body>
<b>Mouse over chang color</b>
<table width="200" height="150">
 <tr>
  <td onmouseover="bgChange('green')"
      onmouseout="bgChange('red')"
      bgcolor="green">
  </td>
  <td onmouseover="bgChange('blue')"
      onmouseout="bgChange('transparent')"
      bgcolor="blue">
  </td>
</tr>
  </table>
</body>
</html>

No comments:

Post a Comment