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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T12:10:03+00:00 2026-06-08T12:10:03+00:00

So I have a checkbox and a span <input type=checkbox class=checker> <span class=something>Label</span> From

  • 0

So I have a checkbox and a span

<input type="checkbox" class="checker"> <span class="something">Label</span>

From which the span already has some functionality based on clicking it, I am adding a checkbox to the equation for visual aid. What I am trying to do is, when the checkbox is checked/unchecked I want it to trigger the spans already existing click function. Which this I can do.

I also want the same click function on the span to check/uncheck the checkbox next to it, while continuing its base function. Which this I can do as well.

The snag it seems is when I have both logics in the script, one will always X out the other, leaving one working and the other not. So I am trying to figure out how to make this work in harmony and I apparently am having issues thinking outside the box at the time and need some assistance getting there.

Here is the JS I am attempting to use currently

$('.checker').live('click', function(e){e.preventDefault();$(this).siblings('.something').trigger('click');});
$('.something').live('click', function(e)
{
    e.preventDefault();
    if($(this).siblings('.checker').is(':checked'))
    {
        $(this).siblings('.checker').attr('checked', false);
    }
    else
    {
        $(this).siblings('.checker').attr('checked', true);
    }
});
  • 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-08T12:10:04+00:00Added an answer on June 8, 2026 at 12:10 pm

    Please use Label Tag

    <li class="contact">
        <input id='input1' type="checkbox" class="checkbox" name="checkableitems[]" value="1333">
        <label for='input1'>Baby James</label>
    </li>
    

    http://jsfiddle.net/xgB5X/5/

    Still you want it in your style then please refer this fiddle.

    $('.something').on('click', function() {
        var chk_box = $(this).prev();
        var chk_status = !(chk_box.is(':checked'));
        chk_box.attr('checked', chk_status);
    });
    

    http://jsfiddle.net/xgB5X/10/

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

Sidebar

Related Questions

I have an Element Like <div class=control> <label>&nbsp;</label> <input type=checkbox id=1><span class=controlText>Check Box</span> <div
I have some html form <div id=1> <div> <span class=checkbox style=background-position: 0pt -34px;></span> <input
I have this HTML code which simulates a dropdown multi-checkbox <div> <div class=select> <span>Select
I have some html code <div class=filters-widget bordered> <span class=checkbox style=background-position: 0px 0px; ></span><input
I have this code <input type=checkbox/> <span>Foobar</span> <input type=radio checked=checked>Foo <input type=radio>Bar How to
I have a HTML snippet like the following <tr class=new> <td> <input name=id type=checkbox/>
I have this: <span id=social> Facebook: <input id=id_connected_to_facebook type=checkbox name=connected_to_facebook> <br> Twitter: <input id=id_connected_to_twitter
I have a checkbox which in some cases may be disabled and checked using
This is the checkbox <input id=c1 type=checkbox name=hour[] class=create-daily value=1 /><br /> <input id=c2
I have a question div which looks like so: <div class=Q> <div id=Q1><span>1. </span>Which

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.