JSFiddle - React, Tailwind, and code Playground

by hollanditkzn

HTML

<div>
        <label>Вопрос </label>
        <input type="text" name='Question'>

    </div>
    <div>
        <label>Ответ 1 </label>
        <input type="text" name='Answer[1]'>
        <label><input type="radio" value='' name='right'>Правильно</label>
    </div>
    <div>
        <label>Ответ 2 </label>
        <input type="text" name='Answer[2]'>
        <label><input type="radio" value='' name='right'>Правильно</label>
    </div>
    <div>
        <label>Ответ 3 </label>
        <input type="text" name='Answer[3]'>
        <label><input type="radio" value='' name='right'>Правильно</label>
    </div>
    <div>
        <label>Ответ 4 </label>
        <input type="text" name='Answer[4]'>
        <label><input type="radio" value='' name='right'>Правильно</label>
    </div>

JavaScript

$('input').change(function(){
	let value = $(this).val();
  $('radio').attr('value', value)
})