URL: https://www.overclockers.at/coding-stuff/html_tabelleninhalt_dynamisch_ueber_mouseover_aend_116446/page_1 - zur Vollversion wechseln!
Hi, gibts eine Möglichkeit, den html text, der in ner tabellenzelle steht, über eine mouseover funktion zu ändern?
ich kann mit js zwar auf css eigenschaften zugreifen, und diese ändern, aber kann ich auch den text in ner tabelle damit ändern?
mfg
grassi
Hm gibts da nicht so eine Funktion beim DHTML ?
Zitat von grassi3000Hi, gibts eine Möglichkeit, den html text, der in ner tabellenzelle steht, über eine mouseover funktion zu ändern?
ich gebe zu, die frage so gestellt zu haben, dass diese antwort auch ausreicht, aber dennoch würde ich mich über hinweise, bzw. exakte angaben über diese funktion freuenZitat von thatJa.

Zwar nicht Standard, aber von IE und Mozilla unterstützt:
cell = document.getElementById(...); // oder wie auch immer du an die Zelle herankommst
cell.innerHTML = "irgendwas";
ansonsten (DOM-konform, unter der Annahme dass nur ein Text in der Zelle steht):
newnode = document.createTextNode("muh");
if (cell.hasChildNodes())
cell.removeChild(cell.firstChild);
cell.appendChildNode(newnode);
Weitere Infos:
http://www.w3.org/TR/REC-DOM-Level-1/
Noch was Schönes dazu:
http://www.developer-x.com/content/innerhtml/
thx, werd mich mal da umsehen
HOPPS...HAB WAS FALSCHES GEPROGGT
warum so kompliziert?? 
es geht ja ganz einfach 
Code: PHP<table border="1" bordercolor="black"> <tr style="background-color: #7499fc"> <td width="200px" onmouseover="this.style.backgroundColor='#AAAABB'" onmouseout="this.style.backgroundColor='#7499fc'"> blabla </td> <td width="200px" onmouseover="this.style.backgroundColor='#AAAABB'" onmouseout="this.style.backgroundColor='#7499fc'"> blabla </td> <td width="200px" onmouseover="this.style.backgroundColor='#AAAABB'" onmouseout="this.style.backgroundColor='#7499fc'"> blabla </td> </tr> <tr style="background-color: #BBCCff"> <td width="200px" onmouseover="this.style.backgroundColor='#CCDDFF'" onmouseout="this.style.backgroundColor='#BBCCff'"> blabla </td> <td width="200px" onmouseover="this.style.backgroundColor='#CCDDFF'" onmouseout="this.style.backgroundColor='#BBCCff'"> blabla </td> <td width="200px" onmouseover="this.style.backgroundColor='#CCDDFF'" onmouseout="this.style.backgroundColor='#BBCCff'"> blabla </td> </tr> </table> <br /> <br /> <br /> <table border="1" bordercolor="black"> <tr style="background-color: #7499fc" onmouseover="this.style.backgroundColor='#00ff12'" onmouseout="this.style.backgroundColor='#7499fc'"> <td width="200px"> blabla </td> <td width="200px"> blabla </td> <td width="200px"> blabla </td> </tr> <tr style="background-color: #BBCCff" onmouseover="this.style.backgroundColor='#00ff12'" onmouseout="this.style.backgroundColor='#BBCCff'"> <td width="200px"> blabla </td> <td width="200px"> blabla </td> <td width="200px"> blabla </td> </tr> </table>
grassi, das sollte jetzt stimmen:
Code: PHP<table> <tr> <td onmouseover="this.innerText = 'owned!' "> overclockers.at </td> </tr> </table>
Zitatwarum so kompliziert??
es geht ja ganz einfachCode: PHP<table border="1" bordercolor="black"> <tr style="background-color: #7499fc"> <td width="200px" onmouseover="this.style.backgroundColor='#AAAABB'" onmouseout="this.style.backgroundColor='#7499fc'"> blabla </td> <td width="200px" onmouseover="this.style.backgroundColor='#AAAABB'" onmouseout="this.style.backgroundColor='#7499fc'"> blabla </td> <td width="200px" onmouseover="this.style.backgroundColor='#AAAABB'" onmouseout="this.style.backgroundColor='#7499fc'"> blabla </td> </tr> <tr style="background-color: #BBCCff"> <td width="200px" onmouseover="this.style.backgroundColor='#CCDDFF'" onmouseout="this.style.backgroundColor='#BBCCff'"> blabla </td> <td width="200px" onmouseover="this.style.backgroundColor='#CCDDFF'" onmouseout="this.style.backgroundColor='#BBCCff'"> blabla </td> <td width="200px" onmouseover="this.style.backgroundColor='#CCDDFF'" onmouseout="this.style.backgroundColor='#BBCCff'"> blabla </td> </tr> </table>
Code:<public:attach event="onmouseover" onevent="hoverIn()" /> <public:attach event="onmouseout" onevent="hoverOut()" /> <script language="jscript"> function hoverIn() { this._realColor = this.currentStyle.backgroundColor; this.runtimeStyle.backgroundColor = '#FEDB99'; } function hoverOut() { if (this._realColor) { this.runtimeStyle.backgroundColor = this._realColor; } } </script>
overclockers.at v4.thecommunity
© all rights reserved by overclockers.at 2000-2026