DannyLupo: hintergrundbild von <td> ansprechen

Beitrag lesen

hallo und guten abend!

N'abend

ich versuche nun schon seit einiger zeit verzweifelt, das hintergrundbild einer zelle via javascript zu ändern.
meine frage: wie spreche ich diese zelle an? ich muss ihr eine id geben, richtig? muss ich sie jedoch über das table-tag ansprechen? ich habe alles probiert aber finde keine lösung..

Hier ein Script dafür (ist allerdings nicht Netscape-kompatibel)

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<SCRIPT language="JavaScript"><!--
function mOver(cell)
{
   if (!cell.contains(event.fromElement))
   {
      cell.style.cursor = 'hand';
      cell.bgColor = '#999999';
   }
}

function mOut(cell)
{
   if (!cell.contains(event.toElement))
   {
      cell.style.cursor = 'default';
      cell.bgColor = '';
   }
}

function mClick(cell)
{
   if(event.srcElement.tagName=='TD')
   {
      cell.children.tags('a')[0].click();
   }
}
//-->
</SCRIPT>
</head>

<body bgcolor="#FFFFFF" onLoad="">
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="114" align="center" valign="top">
      <table border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td onMouseOver="mOver(this);" onMouseOut="mOut(this);" onClick="mClick(this);">
            <p><a href="..." target="haupt">Erstes Feld</a> </p>
          </td>
        </tr>
        <tr>
          <td onMouseOver="mOver(this);" onMouseOut="mOut(this);" onClick="mClick(this);">
            <p><a href="..." target="haupt">Zweites Feld</a></p>
          </td>
        </tr>
      </table>
      </td>
  </tr>
</table>
</body>
</html>

es dankt, mike

bittschön, der Danny