This is my first Javascript task and they want me to create this alert. The thing is I've tried using the on-click attribute, but it doesn't work when I right-click. help? also, do I need to disable the default context menu for this?
onContextMenu is the event you need
HTML
<img oncontextmenu="myFunction()" contextmenu="mymenu">
Javascript
function myFunction() {
alert("You right-clicked the img");
}
External example can be found here https://www.w3schools.com/jsref/event_oncontextmenu.asp