document.all.mydiv.innerText = sum does not work in Firefox -what to do?

K

Klaus Jensen

Hi

I use this code:

document.all.mydiv.innerText = sum;

to show a calculated value (sum) in a div (your typical running sum thingy).

It works great in IE, but not in Firefox. What to do?
 
E

Evertjan.

Klaus Jensen wrote on 21 aug 2007 in comp.lang.javascript:
Hi

I use this code:

document.all.mydiv.innerText = sum;

to show a calculated value (sum) in a div (your typical running sum
thingy).

It works great in IE, but not in Firefox. What to do?

innerText is IE only

document.all is nearly so

use:
<div id='myDiv'>...

and:
document.getElementById('myDiv').innerHTML = sum;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top