www.webdeveloper.com
Results 1 to 3 of 3

Thread: DOM writing list item into the middle of a list

  1. #1
    Join Date
    Dec 2002
    Location
    Manchester, UK
    Posts
    6,276

    DOM writing list item into the middle of a list

    OK, I can write to the end of a list, but I don't know how to write into the middle of a list. Any Ideas. Here's some code similar to what I already have:
    Code:
    document.getElementById("the_ul").appendChild(document.createElement("li"));
    Every fight is a food fight when you’re a cannibal.

  2. #2
    Join Date
    Dec 2002
    Location
    Calgary, Canada
    Posts
    6,119
    insertBefore() and insertAfter() functions can be used for this purpose
    Cheers

    Khalid

    Message Posting Guidelines In These Forums, Please read these before posting any question.
    Web site: webapplikations.com
    Web Resources Page:Web Resources

  3. #3
    Join Date
    Dec 2002
    Location
    Manchester, UK
    Posts
    6,276
    How handy, thank-you.
    Every fight is a food fight when you’re a cannibal.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles