I\'m trying to get the id,name, and value from Select field element of Material-UI react component.
This is my container:
//some code is removed to k
I'd keep it simpler using event.currentTarget
instead of event.target
.
In your event handler, you can access the attribute of interest from the element that triggered the event by:
_onChange(evt) {
console.log(evt.currentTarget.getAttribute("data-name");
console.log(evt.currentTarget.getAttribute("data-value");
}
thus calling .getAttribute
on the attribute name prepended by "data-"