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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T11:42:53+00:00 2026-06-08T11:42:53+00:00

I have a group of Selects. I am trying to do something like: If

  • 0

I have a group of Selects. I am trying to do something like:

If each $("option:selected") has $(this).val='equal in all' do something.

But I don’t know if I try to put each value in a var then compare or do a count.

Maybe should it be something like IF ALL has….

This code works, but can see what to do with it…

It is inside an on change function, so it will alert only when I select

$("option:selected").each(function () {
    alert ($(this).val();)
});

It is something like this.

If both(all) selects is selected if value= Show All, do something.

  • 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-06-08T11:42:56+00:00Added an answer on June 8, 2026 at 11:42 am
    if ($('option:selected[value="equal in all"]').length > 0){
      // "equal in all" is selected
    }
    

    You can use the attribute equals selector, then check the length property to see how many elements matched that selector.

    You can also compare how many values equal “equal in all” versus all elements selected by caching the first selector, then storing a filtered version (and comparing length). e.g.

    var selectedOptions = $('option:selected'),
        optionsEqualInAll = selectedOptions.filter('[value="equal in all"]');
    if (selectedOptions.length == optionsEqualInAll.length){
      // all selected options have the value "equal in all"
    }
    

    Other than that, the question is a bit vague and maybe if you can be more explicit about what you’re going for I can update my answer.

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

Sidebar

Related Questions

i have this code right here: <select name=group> <option value=>Choose a group....</option> <?php foreach($groups
I have a table which looks something like this sell_price double buy_price double time
I'm pretty new to SQL, and I'm trying to do something like this: I
Feel like this should be something easy that I'm missing. I have a table
I'm trying do something like this: SELECT * FROM table WHERE column IN (1,2,3)
I am trying to do something like this, and I'm not sure if it's
I have a list of items that can be represented like this: ClientNo Name
I have a collection of objects, each has a field called fingerprint which contains
I have this query that calculates current gallons value from all fuel tanks in
Yes, this is probably yet another greatest-n-per-group question... But I've tried at least a

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.