javascriptprototypejsright-click

addEventListener to right click event


I would like to add event listener to a right click event, i know how to deal with a simple click: document.getElementById("myBtn").addEventListener("mousedown", function(){ });

What about a right click event ?


Solution

  • Just testing the click type using : alert("You pressed button: " + event.button)