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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:25:43+00:00 2026-05-27T21:25:43+00:00

I have the following HTML : <label> <input type=’checkbox’ checked=checked /> CLICK ME…. </label>

  • 0

I have the following HTML :

<label>
    <input type='checkbox' checked="checked" />
    CLICK ME....
</label>

and script :

$(document).ready(function(){
    $("label").on("click",function(){
        if ($(this).children("input[type='checkbox']").is(':checked'))
        {
            //alert("checked");
           // return false;
        }
        else

        {
           // alert("not checked");
              // return false;        
        }
    });
});

How can i get the checked state ? If its checked i want to perform some operations other ways some other .

I used Live/On because the contend is dynamically added.

Please check this jSfiddle

  • 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-27T21:25:43+00:00Added an answer on May 27, 2026 at 9:25 pm

    Tried this and worked (jQuery 1.7.1):

    <label>
        <input type='checkbox' checked="checked" />
        CLICK ME....
    </label>
    <div id="result"></div>
    
    $(document).ready(function(){
        $("label").live("click",function(){
            var elem = $(this).children("input[type='checkbox']");
    
            $('#result').html('prop: ' + elem.prop('checked'));
        });
    });
    

    jsFiddle: http://jsfiddle.net/tNGqs/

    UPDATE: After your comments I’ve created second jsfiddle: http://jsfiddle.net/8ByqX/

    As I understand you want to get rid of firing event on child element. You should define stop propagation on element:

    $(value).click(function(e) {
        e.stopPropagation();
    });
    

    Look also at Hello71’s comment on accepted answer here:

    How to check for a click in a parent element, but not in the child?

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

Sidebar

Related Questions

i have the following jquery code: $(document).ready(function() { $('.restrictiveOptions input[type!=checkbox], .restrictiveOptions select').change(function() { //
I have following html: <label for=live>Live</label> <input type=checkbox name=live id=live /> How to save
I have the following HTML <div> <label for=username>Username:</label> <input type=text name=username id=username /> <span>some
Given the following HTML structure: <input class=addon-thumb type=checkbox name=foo/><label for=foo><img class=addon-thumb src= title=bar alt=foo/></label>
I have the following html: <label class=description>Label Text</label><input type=password /> And the css styles
I have the following code: JS <script type=text/javascript> $(function(){ $('#fgotpwfield').hide(); $('#login_submit').click(function() { $('#form_result').fadeOut('fast'); $('#myccrxlogin
I have the following fields: <label>Company Type:</label> <label for=primary><input onclick=javascript: $('#sec').hide('slow');$('#primary_company').find('option:first').attr('selected','selected'); type=radio runat=server name=companyType
So I have the following html: <div id=divForComponents> <input type=button value=+ onclick=addFilter('divForComponents')/> </div> And
I have the the following html elements: <tr> <td> <label for=casenumber>Case:</label></td> <td> <%=Html.TextBox(casenumber, ,
I have the following <label for=Forename>Forename</label> <%= Html.TextBoxFor(m => m.Customer.Name.Forename) %> the problem with

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.