About this question
I am writing a code in JS to receive name and value attributes from the Lightning-Input Radio button where an event will take place on selection. But in the JS file, it's giving me an error while assigning the event values to const variables. Please help.
HTML CODE
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