I created a simple event listener for clicks:
window.addEventListener("click", function (event) {
console.log(event);
});
From what I see, the event object contains a lot of useful data about the parent elements, HTML and CSS data of the clicked element.
Is there a way to build a CSS-selector (hopefully unique) from these event objects? If yes, are there any open-source solutions you can think of?
event.target). That selector is not likely to be useful, however. Without knowing what you want to do with it, we can't reasonably answer this question.body div:nth-child(44) span:nth-child(3).