Jutta: Funktions Problem this

Beitrag lesen

Hallo,
ich habe folgendes Script welches natürlich nicht funktioniert?
An dem ich auch schon 2 Tage ausprobiere aber momentan kein Stück weiterkomme...

Irgendwas ist bei der Funktionaufruf / Übergabe von ChangeText(txt,obj); falsch?

---- schnipp -----

<script language="JavaScript">

var aktiveZeile=false;
   function ChangeCol(objekt)
   {
   if(objekt.id!=aktiveZeile)
    {
    objekt.style.backgroundColor="#cccccc";
    }
   }

function ChangeText(txt,obj)
   {

var txt = "if(aktiveZeile){document.getElementById(aktiveZeile).style.backgroundColor='#cccccc';}
    aktiveZeile=this.id;
    ChangeTxt('text 1');
    this.style.color='black';";

this.id = txt;
   }

</script>

<table>
   <tr style="background: #cccccc;"
    onmouseover="this.style.cursor='hand' ; this.style.backgroundColor='green' ; status='over 1'"
    onmouseout="ChangeCol(this)  ; status=''"

onclick="ChangeText('txt',this);"
    id="tab1">

<td>
   1111
   </td>
   </tr>
   </table>

<table>
   <tr style="background: #cccccc"
    onmouseover="this.style.cursor='hand' ; this.style.backgroundColor='green' ; status='over 2'"
    onmouseout="ChangeCol(this)  ; status=''"

onclick="ChangeText('txt',this);"
    id="tab2">

<td>
   2222
   </td>
   </tr>
   </table>

<table>
   <tr style="background: #cccccc;"
    onmouseover="this.style.cursor='hand' ; this.style.backgroundColor='green' ; status='over 3'"
    onmouseout="ChangeCol(this)  ; status=''"

onclick="ChangeText('txt',this);"
    id="tab3">

<td>
   3333
   </td>
   </tr>
   </table>

----- schnapp -------