We will use menu command in HTML5 to create menu commands. We will use <menu> tag for grouping commands item. In command tag we will define command button like a radio button, a check box or a button. Command elements are visible only if it is inside menu element.

Following example will demonstrate use of menu tag
<body>
    <menu>
        <!--Creating first menu command. Here we use command tag and apply css using style property. -->
        <command onclick="alert('First Menu Command button is clicked.')">
            <button>First Menu Command</button>
        </command>
        &nbsp;&nbsp;
        <command onclick="alert('Second Menu Command button is clicked.')">
            <button>Second Menu Command</button>
        </command>
        &nbsp;&nbsp;
        <command onclick="alert('Third Menu Command button is clicked.')">
            <button>Third Menu Command</button>
        </command>
    </menu>
</body>
Output of following code snippet is as follows

Menu command in HTML5Menu command in HTML5


  Modified On Nov-17-2017 06:46:35 AM

Leave Comment