SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Addict lundberg's Avatar
    Join Date
    Mar 2003
    Location
    Sweden
    Posts
    370
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Set the inner text of an element?

    Hello!

    If I've got this: <span id="fne"></span> how do I from a javascript function set the inner text of the element? for example form <span id="fne"></span> to <span id="fne">Martin</span>!?

    Thanks in advance!

    Martin Lundberg
    Sweden

  2. #2
    SitePoint Wizard
    Join Date
    Jul 2003
    Location
    Kent
    Posts
    1,921
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    var fneT = document.getElementById("fne");
    fneT.innerHTML="Martin";


Bookmarks

Posting Permissions

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