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 4381408
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T12:38:43+00:00 2026-05-21T12:38:43+00:00

is there a way to do: if options have class 1 and 2 then

  • 0

is there a way to do: if options have class 1 and 2 then add class A in jQuery?

So this :

<select class="rubrique" name="ctl00">
            <option class="" value="" selected="selected"></option>
            <option class="1" value="1">1</option>
            <option class="2" value="2">2</option>
           </select>

would give me that:

 <select class="rubrique" name="ctl00">
            <option class="" value="" selected="selected"></option>
            <option class="1 A" value="1">1</option>
            <option class="2 A" value="2">2</option>
           </select>
  • 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-21T12:38:44+00:00Added an answer on May 21, 2026 at 12:38 pm

    If you want both class 1 and class 2 to be present:

    $('.rubrique > .1.2').addClass('A');
    

    You can chain the class-selector . and class-names to find elements with both.

    Otherwise, as noted, if you want to add class A to both:

    $('.rubrique > .1, .rubrique > .2').addClass('A');
    

    Is what’s needed.

    With thanks @T.J. Crowder for pointing out my original mis-reading of the question example.

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

Sidebar

Related Questions

Is there any way to make the option group selectable? <select> <optgroup value=0 label=Parent
Is there a way to mark issues with different options than the default Bug\Feature\Support
Is there a way to make the @RequestBody annotation options (e.g. required=false) like RequestParam
Is there a way to automatically open up the Windows Performance Options dialog using
Is there a way or special curl option to recognize a no-connection-situation when curlGetResponse_
...is there any way of checking such thing? The default option as i remember
Possible Duplicate: Any way to “reboot” the JVM? Is there any option to restart
Is there way to automatically maximize the output window on hitting build and then
I have form, where user selects Airport and then can select one of airport
I have a Java class which can be called from shell. (via java [command][options])

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.