I was working on my react project and I put an onClick function and dataset to my <tr> element like this
<tr key={index} onClick={ev} data-ti={ddd.id} className={classs}>
and so in that ev function I tried to get the value from the dataset like this
function ev(e){
const {ti} = e.target.dataset
console.log(ti) // returns undefined
}
and instead of returning an id it returns undefined am I doing something wrong or maybe there's another way of doing it