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

  • Home
  • SEARCH
  • 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 7443935
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T11:24:38+00:00 2026-05-29T11:24:38+00:00

I am using jQuery 1.4.3 I have several input that look like this: <input

  • 0

I am using jQuery 1.4.3

I have several input that look like this:

 <input type='checkbox' id='1' class='Product' comp='1'>
 <input type='checkbox' id='2' class='Product' comp='1'>
 <input type='checkbox' id='3' class='Product' comp='1'>
 <input type='checkbox' id='4' class='Product' comp='2'>
 <input type='checkbox' id='5' class='Product' comp='2'>
 <input type='checkbox' id='6' class='Product' comp='2'>

If a box with the Product class is clicked I want to get its comp value and uncheck the other boxes that have a different comp value.

Normally, I would loop through and check each comp value and then uncheck where necessary, like this pseudo code:

ThisComp == 1 // comp value of checkbox that was just clicked
$(".Product").each(function() {
     var Comp $(this).attr("comp");
     if (ThisComp != Comp) {
         // $(this).attr("checked", false);
     }
});

I am wondering if there is a way to filter using the comp value in the selector, such as this pseudo code:

$(".Product comp=2").attr("checked", false);

The goal here is to uncheck any box that has a different comp value than the one clicked in an efficient way.

  • 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-29T11:24:39+00:00Added an answer on May 29, 2026 at 11:24 am

    http://api.jquery.com/category/selectors/

    $(".Product[comp!='2']").attr("checked", false);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a few <input> elements that look like this: <input id=hosts name=250 class=hostselector
Total beginner question about jQuery: I have a Form that contains several TextBoxes (input
I have a form with several fields and using jQuery validation plugin. My input
I have started using jQuery and rails. I have made a simple form that
Here is what I have <form> <input type=text name=item1 class=grab value=userInput /> <input type=text
I have started using jQuery Validation plugin 1.7. I have a wizard like interface
Using jQuery version 1.4.2 and Validation plugin version 1.8.1 I have a textbox that
Hey right now I'm using jQuery and I have some global variables to hold
using jquery v1.3.2 and jQuery UI 1.7.1 I have 1 tab control with 3
Using jQuery, how would you find elements which have a particular style (eg: float:

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.