Click to See Complete Forum and Search --> : how to make tables' content dynamic?


irit19
July 27th, 2002, 02:11 PM
Hi everybody,

I write for netscape. I have a simple table like this:

<table id="table1">
<tr id="tr1">
<td id="td11">text1</td>
<td id="td12">text2</td>
</tr>
<tr id="tr2">
<td id="td21">text3</td>
<td id="td21">text4</td>
</tr>
</table>

and I want to change the content of the <td> dynamicly. the problem is that I can't access the <td> by the method document.all("tdId") like in IE, also I can't use the innerHTML to change the content cause those two don't exist for netscape, do u have any idea?

gangelo
July 28th, 2002, 11:18 AM
Did you try Did you try innerText ? If that does not work, try embeddng a <div> or <span> in the <td>here</td> i.e. <td><span name="td1">text to be changed</span></td>. You can use innerText to change the span inner text value.

btw, you may have better luck using name= instead of id= - I have had problems using id= with netscape.

good luck