zoukankan      html  css  js  c++  java
  • 学习进度6

    今天主要学习了一些JavaScript的内容

    JavaScript常用来为网页添加各式各样的动态功能,为用户提供更流畅美观的浏览效果。通常JavaScript脚本是通过嵌入在HTML中来实现自身的功能的

    可以说大部门时候是来当函数来验证某些内容的

    <%@ page language="java" contentType="text/html; charset=UTF-8"
        pageEncoding="UTF-8"%>
    <!DOCTYPE html>
    <html>
        <head>
            <meta charset="UTF-8">
            <title></title>
            <script>
                function check(){
                    var username=document.getElementById("username").value;
                    if(username==""){
                        alert("用户名不能为空!");
                        return false;
                    }
                    var password=document.getElementById("password").value;
                    if(password ==""){
                        alert("密码不能为空!");
                        return false;
                    }
                    var repassword=document.getElementById("repassword").value;
                    if(password!=repassword){
                        alert("两次密码不一致");
                        return false;
                    }
                }                                
            </script>
        </head>
        <body>
            <form action="#" method="get" onsubmit="return check()">
                用户名:<input type="text" name="username" id="username" placeholder="请输入用户名"/><br />
                密码:<input type="password" name="password" id="password"/><br />
                确认密码:<input type="password" name="repassword" id="repassword"/><br />
                性别:<input type="radio" name="sex" value="男"/><input type="radio" name="sex" value="女" checked="checked"/><br />
                提交按钮:<input type="submit" value="注册"/><br />
                重置按钮:<input type="reset" />
            </form>
            
        </body>
    </html>
    View Code

    © 版权声明
    文章版权归作者所有,未经允许请勿转载。
    THE END
  • 相关阅读:
    Springboot 基于的SAP项目环境配置
    Impala 技术点梳理
    Elasticsearch 使用技巧笔记
    ELK 6.x 部署
    eclipse安装lombok
    IIS服务器管理学习
    Springboot依赖注入笔记
    Eclipse解决乱码问题
    Springboot依赖注入 Service类中使用静态变量
    javascript 操作符类型隐性转换
  • 原文地址:https://www.cnblogs.com/xp-thebest/p/12288857.html
Copyright © 2011-2022 走看看