File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes HTML, CSS and JavaScript and the fly likes Hide options in drop down Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Hide options in drop down" Watch "Hide options in drop down" New topic

Hide options in drop down

SaurabhSri Sri
Ranch Hand

Joined: May 01, 2008
Posts: 43
Hi Every one,

Is there any way to hide the options in a drop down.

As an example, I have a code as


In this I want to hide option STATE. I have tried display property of style (Please have a look at below code), its working in Firefox Mozilla but not in IE.

<OPTION style = "display:none">STATE</OPTION>

Thanks in advance.

SaurabhSri (SCJP 1.5)
Vilmantas Baranauskas
Ranch Hand

Joined: Dec 20, 2006
Posts: 89
You can remove options from JavaScript:

Author of <a href="" target="_blank" rel="nofollow">NewsInjector</a>
I agree. Here's the link:
subject: Hide options in drop down
It's not a secret anymore!