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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T17:09:12+00:00 2026-06-09T17:09:12+00:00

I need to see if any checkboxes within a range in a fieldset are

  • 0

I need to see if any checkboxes within a range in a fieldset are checked

<fieldset id="issues">
    <input name="A" id="issue_0" type="checkbox" value="A" /> <--- this one
    <input name="B" id="issue_1" type="checkbox" value="B" />
    <input name="C" id="issue_2" type="checkbox" value="C" />
    <input name="D" id="issue_3" type="checkbox" value="D" />
    <input name="E" id="issue_4" type="checkbox" value="E" />
</fieldset>

The field set is #issues, this works fine to see if any of them are checked

if( $('#issues input[type="checkbox"]').is(':checked') ){
  console.log("One of them is checked");
}

But I want to see if a specific checkbox by index is checked, ie if the first one is checked. I tried this…

if( $('#issues input[type="checkbox"][0]').is(':checked') ){
  console.log("Item one is checked");
}

but it doesn’t work

How do I target a specific checkbox by index within a fieldset?

  • 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-09T17:09:14+00:00Added an answer on June 9, 2026 at 5:09 pm
    if( $('#issues input[type="checkbox"]').first().is(':checked') ){
        console.log("Item one is checked");
    }
    

    Use .first() to grab the first one in the wrapped set.

    Also I’d recommend using .prop() as it is easier to deal with when it comes to cross-browser issues!

    if( $('#issues input[type="checkbox"]').first().prop('checked') === true ){
        console.log("Item one is checked");
    }​
    

    If you needed to get a specific index you could do:

    var index = 2;
    if( $('#issues input[type="checkbox"]').eq(index).prop('checked') === true ){
        console.log("Item one is checked");
    }​
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

$i=0; while (db_data) { $i++; echo '<input type=checkbox name=v['.$i.'] value='.$url.''; if ($v[$i]) { echo
Do I even need this rule anymore? I don't see any requests incoming for
I have two Ruby arrays, and I need to see if they have any
I need to check a directory to see if there are any files whose
Everywhere I see, can't find any info about it. I need that people who
In the form designer, I sometimes need to see the type of a property,
I need to see if a modifier key is pressed(shift,ctrl,alt) for my mouse event(basically
I need to see the queries submitted to a PostgreSQL server. Normally I would
I need to see the contents of a std::map variable while debugging. However, if
i need to see a folder (svn) from file system in eclipse (is there

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.