Results 1 to 2 of 2

Thread: JS div replace

  1. #1

    JS div replace

    What's the code - for different browsers - to replace text in a DIV tag? I know it's different for NS, and I have the IE code.
    Thanks

  2. #2
    for example your DIV has id=DivID

    In IE4.0+ (DHTML DOM model) your code has to be like

    document.all.DivID.innerText = 'Some new text to replace old one.'

    In NS6.0+ and in IE5.0+ (W3C DOM) your code will look like

    document.getElementById('DivID').innerText = 'Some new text to replace old one.'

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •