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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:19:57+00:00 2026-05-25T11:19:57+00:00

I am trying to create a functionality that check and uncheck the checkbox on

  • 0

I am trying to create a functionality that check and uncheck the checkbox on label click.

Here is my Jsfiddle: http://jsfiddle.net/PTAFG/1/

The HTML cannot be changed

My HTML:

<div style="float: left; border: 1px solid rgb(255, 153, 0); width: 198px; margin-top: 2px; background: none repeat scroll 0% 0% rgb(255, 255, 255);">
    <label style="float: left; width: 198px; background: url(&quot;../images/ulabel.png&quot;) repeat-x scroll 0% 0% transparent; height: 35px; margin: 0pt; position: relative;">
        <span style="display: block; font-family: Helvetica; font-weight: bolder; margin-left: 20px; margin-top: 10px; font-size: 12px; width: 120px;">UBGRÆNSET TRAFIK</span>
        <input type="hidden" value="0" name="search[php_is_true]"><input type="checkbox" value="1" style="position: absolute; right: 26px; top: 12px;" name="search[php_is_true]" id="search_php_is_true">
    </label>

    <label style="float: left; width: 198px; background: url(&quot;../images/ulabel.png&quot;) repeat-x scroll 0% 0% transparent; height: 35px; margin: 0pt; position: relative; border-top: 1px solid rgb(255, 153, 0); border-bottom: 1px solid rgb(255, 153, 0);">
        <span style="display: block; font-family: Helvetica; font-weight: bolder; margin-left: 20px; margin-top: 10px; font-size: 12px; width: 120px;">UBGRÆNSET PLADS</span>
        <input type="hidden" value="0" name="search[php_is_true]"><input type="checkbox" value="1" style="position: absolute; right: 26px; top: 12px;" name="search[php_is_true]" id="search_php_is_true">
    </label>

        <label style="float: left; width: 198px; background: url(&quot;../images/ulabel.png&quot;) repeat-x scroll 0% 0% transparent; height: 35px; margin: 0pt; position: relative;">
        <span style="display: block; font-family: Helvetica; font-weight: bolder; margin-left: 20px; margin-top: 10px; font-size: 12px; width: 120px;">HJEMMESIDEPROGRAM</span>
        <input type="hidden" value="0" name="search[php_is_true]"><input type="checkbox" value="1" style="position: absolute; right: 26px; top: 12px;" name="search[php_is_true]" id="search_php_is_true">
    </label>
    </div>

My Jquery:

$(document).ready(function() {

$('div').click(
    this.closest('input[type="checkbox"]').attr('checked', true);

});
    $t.closest('.checkGroup').find('.payload').toggle( $t.is(':checked'));
    if( !$t.is(':checked') ){
       $t.closest('.checkGroup').find('.payload input[type="checkbox"]')
           .attr('checked',false);
    }
}).trigger('change');


});
  • 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-25T11:19:58+00:00Added an answer on May 25, 2026 at 11:19 am

    You can use the jQuery prop function to change the checkbox. The code would be

    $('label').bind('click',function(){
      var input = $(this).find('input');  
      if(input.prop('checked')){
        input.prop('checked',false);
      }else{
        input.prop('checked',true);
      }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create a similar functionality to this one: http://www.datatables.net/release-datatables/examples/api/row_details.html . The only
Background: I'm trying to create a pure D language implementation of functionality that's roughly
What I am trying to do is create tooltip functionality so that certain words
I am trying re-create the facebook tagging functionality, where you click on an image
I am trying to create a stop watch type functionality. I have one label
I am trying create a WCF service that leverages the WPF MediaPlayer on the
Ok so I am trying create a login script, here I am using PHP5
Trying to create my first iPhone app that would play back audio. When I
I am trying to create a jQuery hover function that will highlight a different
I'm trying to create moving functionality to my imageView (maskPreview in the code below),

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.