
- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Create a command/menu item that the user can invoke from a popup menu in HTML5
Use the <menuitem> tag to create a command/ menu item that the user can invoke from a popup menu in HTML5. The HTML <menuitem> tag is used for defining a menu item for a menu.
The following are the attributes of the <menuitem> tag −
Attribute | Value | Description |
---|---|---|
checked ![]() | checked | defines that a menuitem should be checked |
default ![]() | default | a menuitem is marked as a default command |
disabled ![]() | disabled | disables a menuitem and cannot be clicked |
icon ![]() | url | defines an icon for a menuitem |
label ![]() | text | defines a name for a menuitem which is displayed to the user |
radiogroup ![]() | groupname | defines a group of commands out of which only one can be selected |
type ![]() | checkbox command radio | defines type of command for a menuitem default is command |
Example
You can try to run the following code to implement <menuitem> tag in HTML5 −
<!Doctype html> <html> <head> <title>HTML menuitem Tag</title> </head> <body> <div style = "border:1px solid #000; padding:20px;" contextmenu = "clickmenu"> <p>Right click inside here....</p> <menu type = "context" id = "clickmenu"> <menuitem label = "Tutorialspoint" onclick = ""></menuitem> <menuitem label = "Tutorials Library" onclick = ""></menuitem> <menuitem label = "Coding Ground" onclick = ""></menuitem> <menuitem label = "Q/A" onclick = ""></menuitem> </menu> </div> </body> </html>
- Related Questions & Answers
- How to create a Popup Menu in Tkinter?
- Android Popup Menu Example
- How to create a User Menu in PowerShell?
- How can we show a popup menu when the user right-clicks on a JComboBox in Java?
- Select item from sub-menu of a menu using mouse over action in Selenium
- How can I create a dropdown menu from a List in Tkinter?
- How to disable a menu item in JavaFX
- How to create a context menu for an element in HTML5?
- How to add accelerators to a menu item?
- How can I separate Menu Items in a Menu with Java?
- Create a tabbed menu with Bootstrap
- How to add the slider to a menu item in JavaFX?
- How to add a separator in Menu item in Tkinter?
- How can we create a JPopupMenu with a sub menu in Java?
- Create a tabbed navigation menu with Bootstrap
Advertisements