Get as e.target the exact element at which onClick is specified?

anjit pariyar
Apr 1, 2021

as we working on we knew that event.target,

get the exact element where we clicked.

even the smallest element too , like span.

so

event.currentTarget

The EventTarget whose EventListeners are currently being processed.

It gets the exact element where onclick event is begin triggered.

const elemClick= (event) => {

let elem = event.currentTarget;

}

Get as e.target the exact element at which onClick is specified?
Get as e.target the exact element at which onClick is specified

--

--