Changing <SPAN... with JS ?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jeff

    Changing <SPAN... with JS ?

    Hello everyone,

    It's possible to change the XXX in this statement with JS?

    <span id="myspan" class="standard-text">XXX</span>

    Thanks very much



  • Evertjan.

    #2
    Re: Changing &lt;SPAN... with JS ?

    Jeff wrote on 11 okt 2003 in comp.lang.javas cript:
    [color=blue]
    > Hello everyone,
    >
    > It's possible to change the XXX in this statement with JS?
    >
    > <span id="myspan" class="standard-text">XXX</span>[/color]

    document.getEle mentById("myspa n").innerHTM L = "with JS"

    ;-)

    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)

    Comment

    • DU

      #3
      Re: Changing &lt;SPAN... with JS ?

      Evertjan. wrote:[color=blue]
      > Jeff wrote on 11 okt 2003 in comp.lang.javas cript:
      >[color=green]
      >> Hello everyone,
      >>
      >> It's possible to change the XXX in this statement with JS?
      >>
      >> <span id="myspan" class="standard-text">XXX</span>[/color]
      >
      > document.getEle mentById("myspa n").innerHTM L = "with JS"
      >
      > ;-)
      >[/color]


      document.getEle mentById("myspa n").firstChild. nodeValue = "with JS";
      is faster, more efficient, is very well supported by current browsers
      and is entirely compliant with DOM 2.

      innerHTML versus nodeValue performance comparison


      DU
      --
      Javascript and Browser bugs:

      - Resources, help and tips for Netscape 7.x users and Composer
      - Interactive demos on Popup windows, music (audio/midi) in Netscape 7.x


      Comment

      Working...