zoukankan      html  css  js  c++  java
  • 初学Javascript,写一个简易的登陆框

    <!--下面是源代码-->

    <!
    DOCTYPE html> <html> <head> <meta charset = "utf-8"> </head> <!--<script type = "text/javascript" src = "test.js"> --> <!-- </script> --> <script> function button_onclick(){ if(document.getElementById("account_value").value == "jeavenwong" && document.getElementById("secret_value").value == "123456"){ document.location = "http://www.cnblogs.com/jeavenwong"; } else{ document.location = "file:///C:/Users/lenovo/Desktop/JsStudy/error.html"; } } </script> <body> <h1>This web is to study javascript!</h1> <p>请登录jeavenwong的博客园</p> 账号:<br/> <input type = "text" id = "account_value" /> <br/> 密码:<br/> <input type = "password" id = "secret_value" /><br/> //我的密码设置的是123456 <br/> <button onclick = "javascript:button_onclick()">提交</button> </body> </html>

    效果如下:

    登陆时:

    登陆正确时跳转到我的博客园:

     登陆错误时跳转到一个错误页面(这个页面几行代码,就不上了):

  • 相关阅读:
    java多线程详解(1)-多线程入门
    有关java中的hashCode问题
    java自动装箱和自动拆箱注意细节
    jquery选择器
    win10专业版激活密钥
    python3小例子:scrapy+mysql
    java List 等份截取
    七大查找算法
    十大经典排序算法
    jQuery.extend()方法
  • 原文地址:https://www.cnblogs.com/jeavenwong/p/7260889.html
Copyright © 2011-2022 走看看