8

I've heard contextmenu is deprecated: https://html.spec.whatwg.org/multipage/obsolete.html#attr-contextmenu

Then, Is there are ways to replace it?

1 Answer 1

7

As the feature was not that popular, it is no longer supported.:

The support for HTML5 context menus, introduced with Firefox 8, will be removed soon. Other browser vendors were not interested in the feature, and therefore it has already been removed from the HTML spec, leaving Firefox as the only browser implementing the and elements as well as the contextmenu global attribute.

If desired, you can instead create your own context menu as seen in some rich web applications like Google Drive. The WAI-ARIA standard provides a way to create accessible menus which is highly recommended.

You can create your own menus using ARIA. Instead of <menu> & <menu-item> you use normal lists (<ul> & <li>), decorate them and use JS for functionality. You find more details and presets here and here.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.