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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T13:49:22+00:00 2026-06-15T13:49:22+00:00

This must be quite simple (and probably a dupe), but I am not seeing

  • 0

This must be quite simple (and probably a dupe), but I am not seeing it just now, and I have been looking!

I read (and attempted) more than just these approaches to my problem:

Click a li to check / uncheck a checkbox

Click a div to check / uncheck a checkbox

…but for the life of me, I seem unable to get the checkboxes in this fiddle:

http://jsfiddle.net/purushagovinda/7wZcS/8/

nor this SO-inspired derivative:

http://jsfiddle.net/purushagovinda/ysKLE/3/

…to behave as per my requirement:

I need that clicking on the text in a <li> will fire the toggle and highlight/un-highlight that text and check/uncheck that corresponding checkbox. Clicking on a checkbox itself should behave the exact same as if the user had clicked the adjacent text instead of the checkbox.

What happens now is that clicking the checkbox does nothing.
I have tried playing (in the first fiddle) with permutations and combinations of these lines:

if (target.is('input:checkbox')) return;

&

   //e.preventDefault();
   //e.stopPropagation();

..but to no avail.

If anyone has any guidance for me, I’d appreciate it.

—Edit:—

I should have mentioned that I need the toggle functions because I am doing a lot more stuff inside those functions that just toggling the font-weight and checking/unchecking the checkbox.

  • 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-15T13:49:23+00:00Added an answer on June 15, 2026 at 1:49 pm

    Put a label around the checkbox and the text, that will make clicking on the text activate the checkbox:

    <label>
      <input type="checkbox" title="Mesh Back" name="products_furniture_finishes" value="13548454609475">
      <span>Mesh Back</span>
    </label>
    

    On the click event of the checkboxes, set the style of the list item depending on the state of the checkbox:

    $("#products_furniture_finishes_options :checkbox").click(function(e) {
      var checked = $(this).is(':checked');
      var li = $(this).closest('li');
      li.css("font-weight", checked ? "700" : "400");
    });
    

    Demo: http://jsfiddle.net/Guffa/7wZcS/9/

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

Sidebar

Related Questions

This must be quite simple, but I just can't find a way. I have
This must be quite simple but I can't seem to figure this out. I've
This must be very simple. But I just can't seem to find the proper
This might be quite simple but I have spent hours in Google but couldn't
This might be quite simple, but I must say I'm a bit confused on
I'm sure this must be something simple, but I can't quite work out what's
This should be quite simple (I think), but I just can't get it right...:|
This must be something simple but it's driving me nuts! I have a migration
This is probably a simple question but I am not an ASP.NET developer and
This must have an obvious solution, but I'm stumped. We are developing an application

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.