need to add a class to the container that has no input selected this is my attempt jquery:
$('.section .container-items input:checked').each( function(){
$('.section .container-items').addClass('red');
});
I need this result

need to add a class to the container that has no input selected this is my attempt jquery:
$('.section .container-items input:checked').each( function(){
$('.section .container-items').addClass('red');
});
I need this result

$("input[type=radio]").on('click', function() {
var container = $(this).parent().parent();
$(".container-items", container).each(function() {
$(this).addClass("red");
});
$(this).parent().removeClass("red");
});
You need to use .change().
$('.section .container-items input').change( function(){
$(this).parent().removeClass('red').siblings().addClass('red');
});
var chck = $('.section .container-items input');//cache selector
chck.change(function () { //change event
chck.filter(':not(:checked)').parent().addClass('red'); //add red to class red to parent if not checked
chck.filter(':checked').parent().removeClass('red'); //checked elements remove red class
}).change(); //trigger change event