Home »

How to write a script for “Select” lists using javascript ?

Question ListCategory: JavascriptHow to write a script for “Select” lists using javascript ?
jeanderson295 author asked 9 years ago
1 Answers
shah_kajal184 author answered 8 years ago

1. To remove an item from a list set it to null
mySelectObject.options[3] = null;

2. To truncate a list set its length to the maximum size you desire

mySelectObject.length = 2;

3. To delete all options in a select object set the length to 0.

mySelectObject.leng

Please login or Register to Submit Answer