469,632 Members | 1,681 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,632 developers. It's quick & easy.

select-option style change in javascript

I guess, the visibility and display styles of an OPTION in a SELECT
list cannot be changed through javascript. I wanted to make some
options unavailable depending on a situation
eg.
<select>
<option id="optID" value="Opt1">Option 1</option>
</select>

document.getElementById("optID").style.visibility = 'hidden';
document.getElementById("optID").style.display = 'none';

this not working.

Any ideas are very welcome.

Oct 26 '06 #1
1 8717
aa**********@yahoo.com wrote:
I guess, the visibility and display styles of an OPTION in a SELECT
list cannot be changed through javascript. I wanted to make some
options unavailable depending on a situation
eg.
<select>
<option id="optID" value="Opt1">Option 1</option>
</select>

document.getElementById("optID").style.visibility = 'hidden';
document.getElementById("optID").style.display = 'none';

this not working.
In IE it doesn't even work if you set these in the CSS.

In Firefox, it works fine.
Oct 26 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

21 posts views Thread by John Fabiani | last post: by
4 posts views Thread by Elroyskimms | last post: by
3 posts views Thread by Tcs | last post: by
7 posts views Thread by Lauren Quantrell | last post: by
1 post views Thread by serena.delossantos | last post: by
2 posts views Thread by naima.mans | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.