Home > Article > Web Front-end > JavaScript gets the mouse click element object (sample code)_javascript skills
IE:
var obj=document.elementFromPoint(event.clientX,event.clientY);
Get object text
var a=obj.innerText
In FF, you need to add an object to the event to read the coordinates.
HTML:
onclick="gj(event)"
JS:
var b=obj
obj=document.elementFromPoint(event.clientX,event.clientY);
}