how to add new more options in select box options using JavaScript . Please tell me what i do for add more options in options box using JavaScript .
How to add new options in select options using JavaScript
Collapse
X
-
That looks like a very IE-specific way of adding options.
I would suggest a simple:
If using the add method, you'd need a try/catch block to deal with IE's non-standard implementation (probably been fixed in newer versions, but I haven't checked).Code:yourSelect.options[yourSelect.options.length] = new Option(text, value);
Comment
-
Comment