Пожалуйста, посмотрите на это, если это то, что вы ищете:
<div id="container">
<div class ="radio01">
<label for="question1">question1</label><input type="radio" name="question1" id="question1" value="answer1">
<label for="question1">question1</label><input type="radio" name="question1" id="question1" value="answer2">
<label for="question1">question1</label><input type="radio" name="question1" id="question1" value="answer3">
<label for="question1">question1</label><input type="radio" name="question1" id="question1" value="answer4">
<label for="question1">question1</label><input type="radio" name="question1" id="question1" value="answer5">
</div>
<div class ="radio02">
<label for="question2">question2</label><input type="radio" name="question2" id="question2" value="answer1">
<label for="question2">question2</label><input type="radio" name="question2" id="question2" value="answer2">
<label for="question2">question2</label><input type="radio" name="question2" id="question2" value="answer3">
<label for="question2">question2</label><input type="radio" name="question2" id="question2" value="answer4">
<label for="question2">question2</label><input type="radio" name="question2" id="question2" value="answer5">
</div>
....
<script>
var selectedAnswers = function () {
var answers = [];
$('input:radio').each(function () {
var $this = $(this),
name = $this.attr('name');
value = $this.attr('value');
if ($(this).prop('checked')) {
answers.push({"name":name, "value":value});
}
});
return answers;
};
$('#container').on('change', ':radio', function() { console.log(selectedAnswers()); });
</script>
Кроме того, ваш html не является "оптимальным" отсутствуетдвойные кавычки и правильная иерархия:
<label>
<input type="radio" name={{$question->id_question}} value= {{$answer[0]}}>
{{$answer[1]}}
</label>
Должно быть (как в моем примере выше):
<input type="radio" name="{{$question->id_question}}" id="{{$question->id_question}}" value=" {{$answer[0]}}">
<label for="{{$question->id_question}}">{{$answer[1]}}</label>