0

I have problem with checkbox. When i choose checkbox, my script mark other checkbox. Ex: If I clicked on the option 1, the script will mark options 101 and vice versa(unmark-unselect).

My code, work once. That is to say: I'm marking field 1, the script selects the 101, later I'm unmarking field 1, the script unselects the 101. Now I want again marking field 1... the skrypt doing nothing.

        var e=$('.serwis_check').eq(i).attr('class').split(/\s+/);


        $.each(e,function(index, item){

            if(item!='serwis_check')
            {
                    if($('.'+item).is(':checked')) {
                        $('#'+item).attr('checked', true);

                    }
                    else 
                    {
                        $('#'+item).attr('checked', false);
                    }
            }

        }); 

I tried: jquery dynamically added checkbox .attr("checked",true) not working

Community
  • 1
  • 1
viko
  • 491
  • 6
  • 23

0 Answers0