Show Output
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>JavaScript Handling the Contextmenu Event</title> </head> <body> <button type="button" oncontextmenu="alert('You have right-clicked a button!');">Right Click on Me</button> <a href="#" oncontextmenu="alert('You have right-clicked a link!');">Right Click on Me</a> </body> </html>