How to get/retrieve context menu value after right click with Javascript?

后端 未结 1 1605
挽巷
挽巷 2021-01-24 23:19

I can\'t find a related question to give me an idea about how to do this.

I\'ve seen some topics about how to know if the right-click button was clicked but I\'d like to

相关标签:
1条回答
  • 2021-01-24 23:37

    In a browser, you can:

    a) ignore the right click and let the browser itself handle it (which usually means a context menu will be shown)

    XOR

    b) handle the right click yourself, which means that the browser won't show its context menu.

    You can't have both a) and b), they're mutually exclusive. If you want a right-click context menu on a webpage, you need to fake it yourself - for example, see this tutorial and the result.

    0 讨论(0)
提交回复
热议问题