Hi,
Jetzt hab ich haber ein <span>-Element eingefügt (um die Schriftfarbe zu ändern) und wenn ich jetzt mit firstChild.data abfrage kommt immer nur undefined(laut firebug).
Was mache ich falsch?
Du fragst die .data-Eigenschaft eines nicht-Textknotens ab - da darf also nur undefined zurueckkommen.
Ich werd aus der Erklärung von firstChild hier auch ned wirklich schlau...
In wie fern denn bitte nicht?
<td id="4"><span style='color:White'>hallo</span></td>
...
var inhalt =document.getElementById(4).firstChild.data;//funktioniert nicht
Doch, "funktioniert", im Sinne von "works as designed".
MfG ChrisB
--
„This is the author's opinion, not necessarily that of Starbucks.“
„This is the author's opinion, not necessarily that of Starbucks.“