Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7416175
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T07:26:31+00:00 2026-05-29T07:26:31+00:00

I am trying to hide some <options> tags with jquery but it doesn’t seem

  • 0

I am trying to hide some <options> tags with jquery but it doesn’t seem to work.

  • I want to hide all options that have the rel attribute.

  • Show only options for rel='3'

This code works on FF and Chrome. Doesn’t work IE, Safari and Opera.

Here is my jsfiddle:

http://jsfiddle.net/RnfqW/4/

Here is the markup and script:

<select name="myselect" id="myselect" >
    <option value=''></option>
    <option rel='1' value='1A'>1A</option>
    <option rel='1' value='1B'>1B</option>
    <option rel='2' value='2A'>2A</option>
    <option rel='2' value='2B'>2B</option>
    <option rel='2' value='2C'>2C</option>
    <option rel='3' value='3A'>3A</option>
    <option rel='3' value='3B'>3B</option>
    <option rel='3' value='3C'>3C</option>
    <option rel='3' value='3D'>3D</option>
</select>

Script:

$("#myselect [rel]").hide(); // hide all options
$("#myselect [rel=3]").show(); // hide whow only rel=3 options
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T07:26:33+00:00Added an answer on May 29, 2026 at 7:26 am

    You can’t hide or show options. What you must do is clone your select and delete option tags you don’t want.

    EDIT : something like that http://jsfiddle.net/RnfqW/5/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to hide some divs that I have created dynamically using the .hide()
I'm trying to hide the Title field in a list. This doesn't seem to
All, I'm removing some select options with jQuery using the following code: $('#other_liked_vendors option[value='
I know that what I'm trying to do is bad idea, but I have
Basically I am trying to show hide divs and links, but having some trouble.
I m trying to show and hide some elements(span) using jquery fadeIn and fadeOut
I have some content being loaded asynchronously on a server that runs jQuery 1.3.2
I'm trying to Display/Hide some select box options depending on the select values from
I am trying to hide some divs before the user prints this giant form,
I'm trying to hide some of my Perl program from the end user to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.