Falls noch aktuell?
<script language="JavaScript">
<!--
function editCell (cell) {
if (document.all) {
cell.innerHTML =
'<input ' +
' id="editCell"' +
' onClick="event.cancelBubble = true;"' +
' onChange="setCell(this.parentElement, this.value)" ' +
' value="' + cell.innerText + '"' +
' size="' + cell.innerText.length + '"' +
'>';
document.all.editCell.focus();
document.all.editCell.select();
}
else if (document.getElementById) {
cell.normalize();
var input = document.createElement('INPUT');
input.setAttribute('value', cell.firstChild.nodeValue);
input.setAttribute('size', cell.firstChild.nodeValue.length);
input.onchange = function (evt) { setCell(this.parentNode,this.value); };
input.onclick = function (evt) {
evt.cancelBubble = true;
if (evt.stopPropagation)
evt.stopPropagation();
};
cell.replaceChild(input, cell.firstChild);
input.focus();
input.select();
}
}
function setCell (cell, value) {
if (document.all)
cell.innerText = value;
else if (document.getElementById)
cell.replaceChild(document.createTextNode(value), cell.firstChild);
}
//-->
</script>
<table border="1">
<tr>
<td onClick="editCell(this);">Mein </td>
<td onClick="editCell(this);">Name </td>
<td onClick="editCell(this);">ist </td>
</tr>
</table>
CB
| -----Original Message-----
| From: [EMAIL PROTECTED]
| [mailto:[EMAIL PROTECTED] On Behalf Of Mayer, Stefan
| Sent: Friday, April 08, 2005 9:14 AM
| To: [email protected]
| Subject: [Coffeehouse] Mit DOM Zelleninhalte �ndern?
|
| Frage: Wie kann ich mittels DOM den Inhalt einer Tabllenzelle
| * setzen
| * erg�nzen
| * l�schen
|
| <table id="MyTable">
| <tr id="MyTR">
| <td id="td1"></td>
| <td id="td2"></td>
| </tr>
| </table>
|
| Sprich: Ich will den Inhalt von td1 und td2 modifizieren.
|
|
| Stefan.
| _______________________________________________
| Coffeehouse Mailingliste, Postings senden an:
| [email protected]
| An-/Abmeldung und Suchfunktion unter:
| http://www.glengamoi.com/mailman/listinfo/coffeehouse
|
|
_______________________________________________
Coffeehouse Mailingliste, Postings senden an:
[email protected]
An-/Abmeldung und Suchfunktion unter:
http://www.glengamoi.com/mailman/listinfo/coffeehouse