I am trying to get the value of the radio button every time I change the active radio button in ReactJS, but the code is capturing the first change only.
in JSX
<input type="radio" name="radio" id="radio1" value="yes" onChange={(e) => this.radioChange(e)} />
<input type="radio" name="radio" id="radio2" value="no" onChange={(e) => this.radioChange(e)} />
and the function
radioChange = (e) => {
console.log(e.target.value);
}
I need to show the selected radio button value in console every time I change the radio button selection
Please help.