Source Code:
(back to article)
Submit
Result:
Report an issue
<!DOCTYPE html> <html> <head> <title>Title of the document</title> </head> <body> <div style="background:#1c87c9; padding: 20px; text-align:center; color:#ffffff;" contextmenu="menuexample"> <p>Right-click inside this box to open the context menu</p> <menu type="context" id="menuexample"> <menuitem label="Refresh" onclick="window.location.reload();"></menuitem> <menu label="Share on..."> <menuitem label="Twitter" onclick="window.open('//twitter.com/intent/tweet?text=' + window.location.href);"></menuitem> <menuitem label="Facebook" onclick="window.open('//facebook.com/sharer/sharer.php?u=' + window.location.href);"></menuitem> </menu> <menuitem label="Email This Page" onclick="window.location='mailto:?body='+window.location.href;"></menuitem> </menu> </div> <p><span style="color:red;">Reminder:</span> This works only in Firefox.</p> </body> </html>