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

Discussion in 'Javascript' started by Klaus Jensen, Aug 21, 2007.

  1. Klaus Jensen

    Klaus Jensen Guest

    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?
    Klaus Jensen, Aug 21, 2007
    #1
    1. Advertising

  2. Klaus Jensen

    Evertjan. Guest

    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;

    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
    Evertjan., Aug 21, 2007
    #2
    1. Advertising

  3. David Dorward, Aug 21, 2007
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Julia Peterwitz
    Replies:
    13
    Views:
    248
    Thomas 'PointedEars' Lahn
    May 30, 2004
  2. sonic
    Replies:
    1
    Views:
    121
  3. Giakko
    Replies:
    9
    Views:
    381
    Randy Webb
    Apr 14, 2006
  4. Replies:
    20
    Views:
    290
  5. Replies:
    3
    Views:
    211
Loading...

Share This Page