[Javascript] Read/write html tag contents with Netscape

Andrew Gibson andyg at ihug.co.nz
Thu Jul 31 18:09:15 CDT 2003


So far as I know document.getElementById(tagName).innerHTML  would work, but
not .innerText in Netscape....

Andrew Gibson

----- Original Message -----
From: Paul
To: javascript at LaTech.edu
Sent: Friday, August 01, 2003 11:04 AM
Subject: [Javascript] Read/write html tag contents with Netscape


I need to read & write the text contained by named html tags.

With recent Internet Explorers one can use innerText, i.e.:

<td name="Tag4">The desired text to read & write</td>
...
function ReadWriteText(argTagName){
alert(argTagName + ' contains ' + document.all.item(argTagName).innerText);
document.all.item(argTagName).innerText = "New contents";
}

How can I do this with Netscape? Is there more than one method, depending
on Netscape/Javscript version?

Thanks!
Paul




More information about the Javascript mailing list