Results 1 to 4 of 4

Thread: Javascript to change a single part of a page?(resolved)

  1. #1

    Thread Starter
    Fanatic Member Graff's Avatar
    Join Date
    Jan 2002
    Location
    Calgary
    Posts
    668

    Javascript to change a single part of a page?(resolved)

    I'm fairly new to javascript and was wondering how I could use javascript to change text in a single part of my table, as opposed to writing the whole page again with document.write.
    Last edited by Graff; Sep 23rd, 2002 at 01:10 PM.
    If wishes were fishes we'd all cast nets.

  2. #2
    Frenzied Member Rick Bull's Avatar
    Join Date
    Apr 2002
    Location
    England
    Posts
    1,444
    You can use innerHTML, although it's not officially in the spec and Opera doesn't [yet] support it:

    Code:
      //NAME attribute:
      document.elementName.innerHTML = '<em>This</em> is the new text, etc';
    
      //ID attribute:
      document.getElementById('elementId').innerHTML = '<em>This</em> is the new text, etc';

  3. #3

    Thread Starter
    Fanatic Member Graff's Avatar
    Join Date
    Jan 2002
    Location
    Calgary
    Posts
    668
    hmm thanks

    who cares about opera (jk... please don't eat my babies)
    If wishes were fishes we'd all cast nets.

  4. #4
    Frenzied Member Rick Bull's Avatar
    Join Date
    Apr 2002
    Location
    England
    Posts
    1,444
    HEh, your babies will be eaten Opera 7 is supposed to be comming out at the end of the year, and it may have a fix for that. They're implementing a better DOM so they may add innerHTML.

Posting Permissions

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



Click Here to Expand Forum to Full Width