DHTMLX Docs & Samples Explorer

### Adding First Item

Source

    <link rel="stylesheet" type="text/css" href="../../codebase/skins/dhtmlxmenu_dhx_skyblue.css">
    <script src="../../codebase/dhtmlxcommon.js"></script>
    <script src="../../codebase/dhtmlxmenu.js"></script>
    <script src="../../codebase/ext/dhtmlxmenu_ext.js"></script>

    <table>
        <tr>
            <td width="300"><div style="height: 250px;"><div id="menuObj"></div></div></td>
            <td width="300"><div style="height: 250px;"><div id="menuObj2"></div></div></td>
        </tr>
    </table>

    <br>
    <script>var menu;
    function doOnLoad() {
        menu = new dhtmlXMenuObject("menuObj");
        menu.setIconsPath("../common/imgs/");
        menu.addNewSibling(null, "opts", "Options");
        menu.addNewSibling("opts", "color", "Color");
        menu.addNewSibling("color", "help", "Help", false);
        menu.addCheckbox("child", "opts", 0, "ignore_case", "Ignore Case", true);
        menu.addCheckbox("child", "opts", 1, "search_everywhere", "Search Everywhere");
        menu.addRadioButton("child", "color", 0, "red", "Red", "color", true);
        menu.addRadioButton("child", "color", 1, "green", "Green", "color");
        menu.addRadioButton("child", "color", 2, "blue", "Blue", "color");
        menu.addNewChild("help", 0, "about", "About...", false, "about.gif");
        menu.addNewChild("help", 1, "help2", "Help", false, "help.gif");
        menu.addNewChild("help", 2, "bugrep", "Bug Reporting", false, "bug_reporting.gif");

        menu2 = new dhtmlXMenuObject("menuObj2");
        menu2.setIconsPath("../common/imgs2/");
        menu2.addNewChild(null, 0, "buddy", "Buddy List");
        menu2.addNewChild(null, 1, "status", "Status");
        menu2.addNewChild(null, 2, "tools", "Tools");
        menu2.addCheckbox("child", "buddy", 0, "show_off_line", "Show Off-Line Buddies", true);
        menu2.addCheckbox("child", "buddy", 1, "buddy_groups", "Buddy Groups", true);
        menu2.addCheckbox("child", "buddy", 2, "protocol_icon", "Show Protocol Icons");
        menu2.addRadioButton("child", "status", 0, "offline", "Off-Line", "status");
        menu2.addNewSeparator("offline");
        menu2.addRadioButton("child", "status", 2, "online", "On-Line", "status", true);
        menu2.addRadioButton("child", "status", 3, "away", "Away", "status");
        menu2.addRadioButton("child", "status", 4, "notavailable", "Not Available", "status");
        menu2.addRadioButton("child", "status", 5, "invisible", "Invisible", "status");
        menu2.addNewChild("tools", 0, "manage_accounts", "Manage Accounts", false, "private_data.gif");
        menu2.addNewChild("tools", 1, "modules", "Modules", false, "addons.gif");
        menu2.addNewChild("tools", 2, "files_transfer", "Files Transfer", false, "../imgs/cut.gif");
    }</script>