js简单模拟div注册登录功能

 <style type="text/css">
        #divadd
        {
            border:1px solid#0094ff;
            background-color:#0094ff;
            height:200px;
            position:absolute;
            right:40%;
            bottom:40%;
            text-align:center;
            display:none;
        }
    </style>
    <script type="text/javascript">
        function gel(id){return document.getElementById(id);}
        window.onload = function () {
            gel("bntAdd").onclick = function () {
                gel("divadd").style.display = "block";
            }
            gel("bntoff").onclick = function () {
                gel("divadd").style.display = "none";
            }
        }
    </script>
</head>
<body>
   <table>
       <tr><td><input type="button" value="显示注册" id="bntAdd"/></td></tr>
   </table>
    <div id="divadd" style="width:300px"><br /> <a>注册号:</a><input type="text"/>
        <br/><br/><a> 密码:</a><input type="text"/><br />
        <input type="button" id="bntoff" value="提交"/><input type="button" value="取消"/>
    </div>
</body>

posted @ 2013-01-22 21:45  逊老头  阅读(269)  评论(0编辑  收藏  举报