Struppi: onClick Wechsel bei Background in Tabelle

Beitrag lesen

Hier noch eine Tabellenzeile:
<td name="fredy" width="161" height="20" background="../_images/aktuell.gif" onclick="changeBg('click', this)" onMouseover="changeBg('over',this)" onMouseout="changeBg('out', this)"></td>

und die Funktion dazu:

var akt;
function changeBg(event, name) {

if (event == "click") {
  name.style.backgroundImage='url(../_images/aktuell_f2.gif)';
  akt = name;
}

Du musst hier den alten Zustand wiederherstellen, in etwa so:

if(akt) akt.style.backgroundImage='url(../_images/aktuell.gif)';

Struppi.