dom - Determine which element the mouse pointer is on top of in Javascript -


i want function tells me element mouse cursor over.

so, example, if user's mouse on textarea (with id wmd-input), calling window.which_element_is_the_mouse_on() functionally equivalent $("#wmd-input")

demo

there's cool function called document.elementfrompoint sounds like.

what need find x , y coords of mouse , call using values:

var x = event.clientx, y = event.clienty,     elementmouseisover = document.elementfrompoint(x, y); 

document.elementfrompoint

jquery event object


Comments

Popular posts from this blog

mysql - FireDac error 314 - but DLLs are in program directory -

git - How to list all releases of public repository with GitHub API V3 -

c++ - Getting C2512 "no default constructor" for `ClassA` error on the first parentheses of constructor for `ClassB`? -