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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T00:32:05+00:00 2026-05-21T00:32:05+00:00

I am looking for a little help building out the correct selector in jQuery.

  • 0

I am looking for a little help building out the correct selector in jQuery. My application uses ASP.NET so I have to deal with client ID’s that are rendered dynamically. Therefore I need to select elements based on assigned class name. The problem with this is that I am using the ASP.NET Checkbox control which wraps a <span> tag the Checkbox control. I currently am able to select the Checkbox I want using input:first-child…

Here is the rendered Checkbox

<span class="CheckboxClassName">
  <input id="xxxxx" type="checkbox" name="xxxxx" checked="checked" />
</span>

Here is the jQuery selector

$(".CheckboxClassName input:first-child")

This selection works by selecting the first child element of the element, which is the Checkbox I want. The problem is I want to modify the selector to select only those Checkboxes that are “Checked”. I was trying to use this …

$(".CheckboxClassName input:first-child:checked")

but it is not working.

Any suggestion on what I am doing wrong and how to select ASP.NET Checkboxes that are selected?

  • 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-21T00:32:05+00:00Added an answer on May 21, 2026 at 12:32 am

    try

    $("span.CheckboxClassName input:checked");
    

    I don’t think that you need the :first selector really, unless there is a chance that you have more than one input as a descendent of a span with the CSS class CheckboxClassName.

    Here’s an example that you can play with.

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

Sidebar

Related Questions

I'm looking for a little help on programmatically passing parameters to a SSRS report
I am writing my first little Access 2003 application. I have two queries that
Have a bit of a weird one and hopefully someone can help out. The
I'm looking for a little shell script that will take anything piped into it,
I'm looking for some information and a little history. I am writing a program
I'm looking to write a plugin for IE that will do a little parsing
I am working on a little pinball-game project for a hobby and am looking
I'm looking for a make platform. I've read a little about gnu make, and
Looking at what's running and nothing jumps out. Thanks!
Looking for feedback on : http://code.google.com/p/google-perftools/wiki/GooglePerformanceTools

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.