|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
I need to change the text in a table cell, or just any text, like
<SPAN id=iddiv> TEXT </SPAN> I found this document.all[id].innerHTML = text on this very forum for IE4, but the snipet for NS4 I don't get to work: document.layers[id].document lyr.open() lyr.write(text) lyr.close() What is missing? What is the difference using SPAN or DIV? Following is the full source, thank you for helping, *Henning <HTML> <HEAD> <script> function WriteIt(id, nestref, text) { //if(ns4) { var lyr = document.layers[id].document; lyr.open(); lyr.write(text); lyr.close(); } //else if (ie4) // document.all[id].innerHTML = text } </script> </HEAD> <BODY> This is the <SPAN id='iddiv'> text </SPAN> . <p> <a href="javascript:WriteIt('iddiv',null,'NEW TEXT')">go</a> </HTML> *Henning [This message has been edited by grisou (edited May 15, 2000).] |
|
#2
|
||||
|
||||
|
Hi Henning - is your <span></span> nested in any other <span>'s or <div>'s if it is you need to tell netscape explicitly where it is ie: if you have a div called <div id=MyDiv> and in it a span called <span id=mySpan>,
Then to reference MyDiv you would have to use -var lyr = document.MyDiv.document.layers[id].document; // where id=MySpan. Hope this is the problem. Regards, Simon. ------------------ Simon Wheeler FirePages -DHTML/PHP/MySQL |
![]() |
| Viewing: Dev Shed Forums > Web Design > HTML Programming > Changeing Span Text |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|