English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
Die globale contextmenu-Attribut ist die ID-Attribut des <menu> für das "Kontextmenü" eines Elements. Ein Kontextmenü ist ein Menü, das bei Benutzerinteraktionen (z.B. rechter Mausklick) angezeigt wird. HTML5Ermöglicht es uns, dieses Menü zu personalisieren. Hier sind einige Implementierungsexemplare, einschließlich eingebetteter Menüs.
Die contextmenu-Attribut ist veraltet und wird aus allen Browsern entfernt.
Weisen Sie dem <div>-Element ein Kontextmenü zu. Wenn der Benutzer mit der rechten Maustaste auf das Element klickt, wird das Kontextmenü angezeigt:
<!doctype html> <html> <head> <meta charset="UTF-8"> <title>HTML contextmenu 属性的使用(基础教程网 oldtoolbag.com)</title> </head> <body contextmenu="share"> <menu type="context" id="share">Test to see ‹/›
IEFirefoxOperaChromeSafari
Currently, only the Firefox browser supports the contextmenu attribute.
The contextmenu attribute specifies the context menu of an element. When the user right-clicks on the element, the context menu is displayed.
The value of the contextmenu attribute is the ID of the <menu> element to be opened.
The contextmenu attribute is an HTML5 new attribute in the middle of.
<element contextmenu="menu_id">
Value | Description |
---|---|
menu_id | The id of the <menu> element to be opened. |