I need a functionality that find xpath of an element when I click on it.
document.addEventListener("click", e => {
let xpath = e.target // I want to find the xpath of this element
})
I searched on Google but I could find anything related to mine. Can anyone point me in the right direction?