Here i am checking parent id of the removal attribute.so how to merge this code with string.
var parentId = $(this).parent().parent().attr('id');
$("#"+parentId ".medicinetype-allergies input[type=checkbox]").removeAttr('checked');
Here i am checking parent id of the removal attribute.so how to merge this code with string.
var parentId = $(this).parent().parent().attr('id');
$("#"+parentId ".medicinetype-allergies input[type=checkbox]").removeAttr('checked');
That should works:
$( "#" + parentId + " .medicinetype-allergies input[type=checkbox]" ).removeAttr('checked');
Note: You missed the second +
operator, which is used to concatenate strings. And don't forget to separate different selectors by space.
Please make sure of '+' operator for your selector
var parentId = $(this).parent().parent().attr('id');
$("#"+parentId+".medicinetype-allergies input[type=checkbox]").removeAttr('checked');