PDA

View Full Version : is document.getElementById('b').innerText supported in Mozilla??


HappyTomato
12-05-2002, 10:18 PM
We have a page running on IE that will display a specific variable in each of the table cells we have, but when we tried to run it on Mozilla, it doesn't work..... each cell is blank...... is "innerText" not supported in Mozilla?? Does anyone know what we can do??

here's what we did:

function displayLink()
{
document.getElementById('link1').innerText = newArray[x1].name ;
document.getElementById('link2').innerText = newArray[x2].name ;
:
:
etc
}

Any suggestiong appreciated!! :thumbsup:


Bo & Vic

chrismiceli
12-05-2002, 10:39 PM
i tried innerText in mozilla, but unsuccessfully, might have been my syntax, but innerHTML works, so just use that.

jkd
12-05-2002, 11:12 PM
document.getElementById('link1').firstChild.nodeValue = newArray[x1].name;

innerText is not standard, nor is innerHTML. Although innerHTML is supported in several browsers, it is still a better idea to avoid using it when possible.

HappyTomato
12-05-2002, 11:17 PM
Thank you all!! :thumbsup: