首页 > 代码库 > 单击右键触发

单击右键触发

oDevId.onmousedown = function(e){
  var e = e || window.event;
  alert(‘e:‘+e.button);
if(e.button == "2"){
  alert(‘‘你点击的是右键)
this.value = http://www.mamicode.com/‘‘; }else if(e.button == ‘0‘){
  alert(‘你点击的是左键‘)
 } }

 

单击右键触发