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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:16:33+00:00 2026-05-26T22:16:33+00:00

(Sort of a newbie question from someone that is more accustomed to how Flash/ActionScript

  • 0

(Sort of a newbie question from someone that is more accustomed to how Flash/ActionScript works.)

Given a checkbox and jQuery click(), how do I do the following:

$('#myCheckBox').click (function(event) {
  checkboxState = event.target.attr("checked");
  // now do something with checkboxState
}

I.e., I want to get the checkbox checked attribute within the anonymous function because that’s the pattern that seems to make the most sense, however I don’t know how this can be done.

Thanks.

  • 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-26T22:16:33+00:00Added an answer on May 26, 2026 at 10:16 pm

    .attr() needs to be called on a jQuery object:

    checkboxState = $(event.target).is(':checked');
    

    or you could use this:

    checkboxState = $(this).is(':checked');
    

    is(':checked') returns true/false depending on the state of the checkbox

    http://api.jquery.com/is/

    http://api.jquery.com/checked-selector/

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

Sidebar

Related Questions

This is sort of SQL newbie question, I think, but here goes. I have
Sort of a methods/best practices question here that I am sure has been addressed,
PHP/MySQL newbie here. I managed to develop a web page that displays info from
again a total newbie question from me about Haskell, and Leskah. (First, a subjective
This is sort of a newbie question, but I was wondering what the best
Here is one more newbie question: require 'tasks/rails' I saw this line in Rakefile
Sort of a weird question. From 4shared video site, I get the embed code
Hiya, I'm sort a newbie when it comes to hibernate so I'm going to
It might be a newbie question, but still.. We are all familiar with Oracle's
Forgive a newbie, I don't even know how to ask this question properly: I

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.