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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T21:18:08+00:00 2026-06-04T21:18:08+00:00

Using jQuery, I hide all check-boxes and radio buttons,and use a CSS background to

  • 0

Using jQuery, I hide all check-boxes and radio buttons,and use a CSS background to indicate theked status. I want to uncheck all check-boxes with radio buttons, but my implementation won’t work as my check-box is still checked although the CSS is changed:

 var fliter_radio=$(".item input[name='group1_radio']");
 var fliter_checkbox=$(".item input[name='group1']");

 fliter_radio.next().click(function(){
                          $(this).prev()[0].checked=true; 
                          $(this).addClass("checked");

                          //#unchecked all checkbox
                          fliter_checkbox.each(function(){
                                 $(this).checked=false;
                                 $(this).next().removeClass("checked"); 
                          })
  })

<li class="item"><input type="radio" id="radio" name="group1_radio" checked="checked" value="unchecked" /><strong>radio button</strong></li>
<li class="item"><input type="checkbox" id="CheckBox1" name="group1" value="news" /><strong>Checkbox1</strong></li>
<li class="item"><input type="checkbox" id="CheckBox2" name="group1" value="news" /><strong>Checkbox2</strong></li>

I rewrite a Complete demo here: http://jsfiddle.net/badjohnny/MnujS/8/

Can you help me implement this correctly?

  • 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-04T21:18:09+00:00Added an answer on June 4, 2026 at 9:18 pm
    $(document).ready(function() {
        function custom_uncheck(radio, checkbox) {
            var fliter_checkbox = $(checkbox);
            var fliter_radio = $(radio);
    
            fliter_checkbox.hide();
            fliter_radio.hide();
    
            fliter_radio.next().on('click', function() {
    
                $(this).addClass('checked')  // add checked class to strong
                      .prev().prop('checked', true); // make check the radio
    
                fliter_checkbox.prop('checked', false)   // make checkbox uncheck
                       .next('strong').removeClass('checked');  // remove checked class
    
            }).click();  // trigger the initial click
    
            fliter_checkbox.next('strong').on('click', function() {// click on checkbox
                $(this).toggleClass('checked')  // changing checked class
                      .prev()  // go to checkbox
                      .prop('checked', function() { // change checkbox check status
                                    return !this.checked;
                               });
                // make uncheck the radio and remove checked class from strong
                fliter_radio.prop('checked', false).next().removeClass('checked');
            });
        }
        custom_uncheck('input[name="all"]', 'input[name="c"]');
    })​;
    

    Working sample

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

Sidebar

Related Questions

all I want to show hide some ids using jQuery. My html code is
I am using JQuery Accordion, I want to hide all the sections on page
How can I hide the scrollbar of using css/jQuery? I notice that the slideDown()
How to hide all elements except one div and its child element using jquery?
I am using the jquery Masonry plugin and looking to hide all content until
I have some DIVs that I am using JQuery to hide and show using
I am using jQuery to show/hide a div container (#pluginOptionsContainer), and load a page
I'm using this jQuery to hide a DIV: $(#slider).click(function() { $(.help).slideToggle(); $(#wrapper).animate({ opacity: 1.0
I am encountering an odd behavior using jQuery to show/hide a menu. I have
How to I hide and show HTML elements using JQuery without any special effects?

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.