Norbert Klein: Tabelenfarbe ändern wenn die Maus über ihr ist...

Beitrag lesen

Hallo.

Folgendes is DOM, d.h ab NS6 un IE5. Ansonsten, kannst du mit document.all und CSS noch en bissel was reißen.

Das kommt in dein <td>:
 onmouseover="this.bgColor = '#0000ff'"   // Neue Farbe
 onmouseout="this.bgColor = '#ff0000'"    // Alte Farbe

Beispiel:
---------
<html>
<head>
<title></title>
</head>
<body>
<table width="50%" border>
 <tr>
  <td bgColor="#ff0000" onmouseover="this.bgColor = '#0000ff'" onmouseout="this.bgColor = '#ff0000'"> </td>
  <td bgColor="#ff0000" onmouseover="this.bgColor = '#0000ff'" onmouseout="this.bgColor = '#ff0000'"> </td>
 </tr>
 <tr>
  <td bgColor="#ff0000" onmouseover="this.bgColor = '#0000ff'" onmouseout="this.bgColor = '#ff0000'"> </td>
  <td bgColor="#ff0000" onmouseover="this.bgColor = '#0000ff'" onmouseout="this.bgColor = '#ff0000'"> </td>
 </tr>
</table>
</body>
</html>

Gruß
Norbert