I have to show different menu above different element. such as, right click over anchor, image, textarea. I want to know how to tell which kind of element under the mouse.
And, if users has selected a few words, the menu should be "copy, select all...", how can I know the selected status in the view.