Date: 2010sep2
Language: javaScript
Q. How can I show/hide a <select>'s <option>s ?
A. With Firefox you can do:
for (i = 0; i < objSelect.options.length; i++) {
if (isWantIt(objSelect.options[i].value)) {
objSelect.options[i].style.display = 'block';
}
else {
objSelect.options[i].style.display = 'none';
}
}
But sadly, that doesn't work in IE.
Changing the className doesn't work either.
With IE you have to change all the options!
| What this info useful to you? You can donate to say thanks |
Add a comment
Sign in to add a comment