menu

I. Description

The HTML <menu> element is an alternative to the <ul> element that should be used when you have an unordered list of items which the user should treat as a list of commands which they can activate. The <menu> element is treated the same way as the <ul> element the only difference being that the <ul> element is used to display an unordered list of items whereas the <menu> element is used for a list of commands or buttons that perform an action.

II. Examples

<!DOCTYPE html>
<html>
    <head>
        <title>Example Page</title>
    </head>
    <body>
        <h1>Calculator Application</h1>
        <form id="calculator" action="calculate()" method="POST">
            <input id="operand_1" name="operand_1" type="number" required/>
            <input id="operand_2" name="operand_2" type="number" required/>
            <menu>
                <li><button value="add">Add</button></li>
                <li><button value="subtract">Subtract</button></li>
                <li><button value="multiply">Multiply</button></li>
                <li><button value="divide">Divide</button></li>
                <li><button value="clear">Clear</button></li>
            </menu>
        </form>
        <p>Calculation Result: <output></output></p>
    </body>
</html>

This document was last updated: