Right click stop propagation

前端 未结 2 693
孤城傲影
孤城傲影 2021-01-21 12:34

How do I stop the propagation for right click events in javascript, so parent elements do not detect them at all? When I click the link in the following html, left clicks are no

2条回答
  •  攒了一身酷
    2021-01-21 12:48

    The 'right click' event is called the 'contextmenu' event.

    http://www.quirksmode.org/dom/events/contextmenu.html


    Example:

    
    
    
    
    
    
    
    
    
    
    Link
    
    

提交回复
热议问题