SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Zealot
    Join Date
    Dec 2008
    Posts
    124
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How can I hide some SELECT element OPTIONs?

    In my CSS, I have a class called "hidden" with the property-

    display: none; color: #333;

    I have some JavaScript event listeners that change the classes for various elements depending on what options the user has selected previously.

    The problem is, that it only works in Firefox (and possibly Safari & Opera). However, in Google Chrome and IE, the elements are not hidden. I know the class is being changed because they are going grey (#333).

    Any ideas?

  2. #2
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,782
    Mentioned
    16 Post(s)
    Tagged
    0 Thread(s)
    This sounds like a JS issue...Got a site? Code? (more)
    Always looking for web design/development work.
    http://www.CodeFundamentals.com

  3. #3
    SitePoint Zealot
    Join Date
    Dec 2008
    Posts
    124
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's not a JS issue.

    The class is successfully being changed as evident by the text going grey.

    It's a browser issue. What I'm after is an alternate way to may the options disappear.

  4. #4
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,782
    Mentioned
    16 Post(s)
    Tagged
    0 Thread(s)
    Try wrapping each option in a span and display:none that. It's a known fact that it doesn't work in IE. Google has ton of threads on this.
    Always looking for web design/development work.
    http://www.CodeFundamentals.com


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •