SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict
    Join Date
    May 2006
    Posts
    349
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to make this include text instead of a url?

    document.getElementById("url").innerHTML = arr[new Date().getSeconds()];

    Hello, I am trying to rotate some text with javascript. I am pretty sure I need the .innerHTML command like the above. What do I replace the "url" with to have it include just text instead of a url? Please let me know, thank you very much.

  2. #2
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,578
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    "url" is the id attribute of an element in your webpage you're changing the innerHTML property of. You can put the id attribute of any element in the page and that's what element will be changed. The code you provided does nothing specific to URLs.

  3. #3
    SitePoint Addict
    Join Date
    May 2006
    Posts
    349
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you very much Dan.
    Last edited by 1Jen; Nov 19, 2006 at 14:10.


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
  •