I'm new to web development and I dont have much experience. I have been trying to create a menu that becomes visible when the user clicks it. I have been able to make it pop-up but it doesnt stay visible. It becomes visible for a second and turns invisible again. I have tried this with the 'display' property as well. However, that has the same results. Here is my code:
<head>
<script type="text/javascript">
    function opnmenu () {
        document.getElementById("menu").style.visibility="visible";
    }
</script>
</head>
<body onLoad="document.getElementById('menu').style.visibility='hidden';">
    <div id="menubar">
        <table>
            <tr>
                <td>
                    <div id="menuimg">
                        <form>
                            <input type="image" class="menubut" src="menu.png" alt="submit" onClick="opnmenu()">
                        </form>
                    </div>
                </td>
            </tr>
        </table>
    </div>
    <br>
    <h1> Entrepreneur</h1>
    <hr>
    <div id="menu">
        <ul>
            <li>Home</li>
            <li>Motivation</li>
            <li>Books</li>
            <li>Videos</li>
        </ul>
    </div>
</body>
Any help will be appreciated. Thank You.