How to remove an option from a list
Hi:
I'm looking to allow users to remove items from a select list, but I'm not certain how to go about that in Javascript. I know how to append items to a select list, but not to remove.
I'm guessing that it will involve returning the options array from the select list, looping through it until the item to delete is found, skipping it, and then running through the remaining items, so that they all move up on position in the index. But that still would seem to leave one extra item (blank) at the end of the list.
This technique would probably be the same as inserting a new option in a select list, as opposed to simply appending to it.
Thanks for your time,
JK
|