function click() 
  {  
   if(event.button==2) 
     { 
        alert(‘hello。。。。。。‘)  
     }  
  }  
  document.onmousedown=click  <body oncontextmenu=self.event.returnValue=false> <body ondragstart="window.event.returnValue=false" oncontextmenu="window.event.returnValue=false" onselectstart="event.returnValue=false"> 原文:https://www.cnblogs.com/friday69/p/9178889.html