Click here to Skip to main content
15,892,674 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
jQuery(document).ready(function ($) {
            $('.chk').change(function () {
                if ($(this).prop('checked')) {
                    //Do stuff
                    alert('0');
                    var selectitem = parseInt($(this).closest('.accordion-group').find('.selectitem').text());
                    if (selectitem != 0) {
                        $(this).closest('.accordion-group').find('.selectitem').text(selectitem - 1);
                    }
                    else {
                        $(this).closest('.accordion-group').find('.select').show();
                    }
                }
                else {
                    var selectitem = parseInt($(this).closest('.accordion-group').find('.selectitem').text());
                    $(this).closest('.accordion-group').find('.selectitem').text(selectitem + 1);
                    $(this).closest('.accordion-group').find('.select').show();

                }
            });
        });
Posted
Updated 8-Jul-15 2:40am
v2
Comments
Thanks7872 8-Jul-15 8:59am    
You have not asked any question but from your title...

Use this : $(this).is(':checked')

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900