Is it possible to determine if the clicked part of an element is text or white space?
https://i.sstatic.net/0pFgB.jpg
My attempts so far have been unsuccessful:
body.addEventListener('contextmenu', (e) => {
e.preventDefault(); // Prevent the default context menu
const clickX = e.clientX;
const clickY = e.clientY;
item = e.target; // Get the clicked element
if (item.textContent.trim() !== '') { do sth...; }
});