Announcement

Collapse
No announcement yet.

appendChild

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • appendChild

    hallo

    ich kopiere mit cloneNode eine tabellenzeile und möchte sie mit appendChild an die tabelle anhänge. Im firefox funkioniert das auch wunderbar, nur im IE will es nicht klappen. Kann mir irgend jemand sagen warum?

    code

    Code:
    function WdhGrpZeitEinfuegen()
    {
    	//Tabellenzeile (TR)
            NextRow = document.getElementById("WdhGrpZeitFirstRow").cloneNode(true);
    	NextRow.id = rowIDZeit;
    	
           //Tabelle (TABLE)
    	document.getElementById("WdhGrpZeit").appendChild(NextRow);
    	
    	rowIDZeit++;
    }

  • #2
    Hi,

    ohne es jetzt zu testen, müsste glaube ich Folgendes funktionieren:

    Code:
    document.getElementById("WdhGrpZeit").getElementsByTagName("tbody")[0].appendChild(NextRow);
    Erklärung:
    Der IE verlangt das optionale tbody-Element beim Zugriff auf die Tabelle. Für ihn sieht die Tabelle also so aus:

    <table>
    <tbody>
    <tr>
    <td>
    </td>
    </tr>
    </tbody>
    </table>

    Schreib bitte, ob es geklappt hat!
    "(...) deshalb mag ich Binärtechnik. Da gibt es nur drei Zustände: High, Low und Kaputt." (Wau Holland)

    Viele Grüße Novi

    Comment


    • #3
      hallo novi

      danke, hat geklappt

      Comment

      Working...
      X