how to hide a option in select

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mukeshrasm
    Contributor
    • Nov 2007
    • 254

    how to hide a option in select

    Hello

    I need to hide a particular option value using css based on a condition but when try to use style for that particular option nothing happen. How can I do it?

    Code:
    <select name="select" class="aa">
      <option value="m" selected="selected">mukesh</option>
      <option value="k" style="display:none;">kumar</option>
      <option value="mi">mishra</option>
    </select>
  • ThatThatGuy
    Recognized Expert Contributor
    • Jul 2009
    • 453

    #2
    <option value="k" style="display: none;">kumar</option>
    this code works... it really hides the element

    try checking it again

    Comment

    • mukeshrasm
      Contributor
      • Nov 2007
      • 254

      #3
      Originally posted by ThatThatGuy
      this code works... it really hides the element

      try checking it again
      this works only in firefox but in ie8 and I want to work in ie8 as well.

      Comment

      Working...