I am trying to access the name of the variable in my html with this
const changeCurrentType = (e) => {
setCurrentType(e.target);
console.log(e.target)
}
The function is able to print this with e.target
How however, when I write
console.log(e.target.name)
It prints undefined. May I know how can I access the name variable of div? In my case, how can I get the "subclub" from name="subclub"?
Thank you.
2
Answers
I managed to solve the question with this line of code to access the div