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

html - Firefox flex bug applied to buttons? -

html - Missing border-right in select on Firefox -

python - build a suggestions list using fuzzywuzzy -