Home > front end > Javascript method in the simulation of the mouse to click, click (), and how to simulate the right m
Javascript method in the simulation of the mouse to click, click (), and how to simulate the right m
Time:10-26
Want to write a simple js script, the function is to canine teeth barrage, for example, b station barrage to realize the function of a report,
CodePudding user response:
Would you please the mouse scroll down , you can see the right mouse button click event
CodePudding user response:
Judging by onm ousedown or onm ouseup event event object For example, Document. The getElementById (" test "). onm ousedown=function (e) { If (e.b utton==2) { Alert (" you some right "); } else if (e.b utton==0) { Alert (" you ordered left "); } else if (e.b utton==1) { Alert (" you ordered roller "); } }