16java任务一 javaweb登陆界面

1.需要掌握的技术

java语言熟练使用,mysql数据库熟练使用,以及环境的配置

2.程序源代码

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title>登陆界面</title>
<script>
function r()
{

    var username=document.getElementById("username");

    var pass=document.getElementById("password");
    if(username.value=="")
    {
        alert("请输入用户名");
        username.focus();
        return;
    }
    if(pass.value=="")
    {
        alert("请输入密码");
        return;
    }
return true;
}
</script>
</head>
<body>
<form>
    <table  width="350" bgcolor="#ccffcc" style="border-color" border="1">
                     <tr align=center>
            <td>用户名</td><td><input type="text" name="username"  id="username"></td>
             </tr>
                     <tr align=center><td>密 码</td><td><input type="password" name="password" id="password"></td></tr>
                     
                     <tr align=center><td colspan="2"><input type="button" value="登 录" onclick="r();"/>     <input type="reset" value="重 置"/></td></tr>
                               
    </table>
</form>
</body>
</html>

3.结果截图

直接点击登录

输入用户名后点击登录

 

 
原文地址:https://www.cnblogs.com/sisi-job/p/5228629.html