I am writing a code in JS to receive name and value attributes from Lightning-Input Radio button where event will take place on selection. But in JS file, its giving me an error while assigning the event values to const variables. Please help.
HTML CODE
<lightning-input name={item.id} type="radio" value="a" label={item.options.a} onchange={changeHandler}></lightning-input>
JS CODE
changeHandler(event)
{
const {name, value} = event.target;
const name = event.target.name;
const value1 = event.target.value;
console.log('name', event.target.name);
console.log('value', event.target.value);
}
ERROR LINES Note: Just added both ways of assigning values for clarification.
const {name, value} = event.target;
const name = event.target.name;
const value1 = event.target.value;
ERROR Screenshot
