2017-07-16 99 views

回答

0
<button id="test">Test</button> 

document.getElementById("test").onmousedown = function(event) { 
    if (event.which == 3) { 
     alert("right clicked!"); 
    } 
} 

鏈接:http://jsfiddle.net/Jmmqz/

+0

謝謝,但不是我在問什麼。我說的是當右鍵單擊並禁用上下文菜單時該按鈕卡住了。 – madprops