By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,116 Members | 1,509 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,116 IT Pros & Developers. It's quick & easy.

select-option style change in javascript

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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.