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. Advertisements

  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. Advertisements

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

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. 用户æƒåˆ©æŒ‡æ´¾é—®é¢˜

    get innerText from different domain document

    用户æƒåˆ©æŒ‡æ´¾é—®é¢˜, Nov 6, 2006, in forum: ASP General
    Replies:
    1
    Views:
    236
    Bob Barrows [MVP]
    Nov 6, 2006
  2. Julia Peterwitz
    Replies:
    13
    Views:
    446
    Thomas 'PointedEars' Lahn
    May 30, 2004
  3. Jim Ley
    Replies:
    3
    Views:
    390
  4. Giakko
    Replies:
    9
    Views:
    582
    Randy Webb
    Apr 14, 2006
  5. sam
    Replies:
    5
    Views:
    216
    Stephen Chalmers
    Jun 6, 2006
  6. Replies:
    20
    Views:
    476
  7. RC
    Replies:
    0
    Views:
    795
  8. Replies:
    3
    Views:
    279
Loading...