javascript - JS code does not work on mobile -
i have following code
$('.checkbox.radio-info input[type="checkbox"]').change(function() { if ($(this).parent().parent().find('input[type="checkbox"]:checked').length > 1) { $(".checkbox.radio-info input[type='checkbox'").prop('checked', false); $(this).prop('checked', true); } });
this works expected on desktop, however, on iphone (ios 9, chrome) doesn't work. not uncheck checkbox when check one.
is there in code device related?
it seems missing "]" in line: $(".checkbox.radio-info input[type='checkbox'").attr('checked', false);
maybe desktop browser more forgiving?
if doesn't help, please share html well.
Comments
Post a Comment