I want to pass a custom attribute to my option field named "data-id":
<option data-id={item.id}>{item.name}</option>
In my onChange function I know how to get the value, I'd do it like : console.log(e.target.value)
But how can you get a custom attribute like 'data-id'. Could you just do 'e.target.data-id' ? That didn't seem to work in my case. Is there a correct way of doing this (if it's even possible)