Results 1 to 3 of 3

Thread: How to remove items from a drop down w/ JavaScript?

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2000
    Posts
    1,091

    How to remove items from a drop down w/ JavaScript?

    A code example of how to remove all items from a drop down list with JavaScript would be greatly appreciated.

    Visual Studio 2010

  2. #2
    Frenzied Member vbNeo's Avatar
    Join Date
    May 2002
    Location
    Jutland, Denmark
    Posts
    1,994
    Try document.myForm.myList.Clear(); - else loop through the items and delete them one by one
    "Lies, sanctions, and cruise missiles have never created a free and just society. Only everyday people can do that."
    - Zack de la Rocha


    Hear me roar.

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2000
    Posts
    1,091
    .Clear doesn't seem to work, but I did find that I can just set the options.length = 0 and that clears the items.

    Visual Studio 2010

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