首页 > 其他分享 >9.15

9.15

时间:2023-09-15 21:11:22浏览次数:27  
标签:function blue color 9.15 验证码 var

javaweb登录界面,js生成随机验证码 <!DOCTYPE html> <html lang="en"> <head>     <meta charset="UTF-8">     <meta name="viewport" content="width=device-width, initial-scale=1.0">     <title>Document</title>     <style>         #center{             width: 16%;             margin: 0 auto;         }         #checkcode{             background-color: rgb(201, 208, 212);             color: blue;             font-size: 30px;         }         #renew{             color: blue;             text-decoration:underline;             cursor:pointer;         }     </style> </head> <body>     <div id="center">         <h1 style="text-align: center">用户登录</h1>         <form action="" method="post">             账号:<input type="text" name="name"><br><br>             密码:<input type="password" name="password"><br><br>             验证码:<input type="text" id="inputcode"><br><br>             <span id="checkcode">123456</span>             <a id="renew">看不清,换一张</a><br><br>             <button id="check">确定</button>             <input type="reset" value="重置">             <script>                 //加载时生成验证码                 window.onload=function(){//打开网页,立刻执行函数                     var res=getcode();                     function getcode(){                         var str='';                         for(var i=0;i<6;i++){                             var num=Math.round(Math.random()*9);                             str +=num;                         }                         return str;                     }                     document.getElementById('checkcode').innerText=res;                     //点击生成验证码                     document.getElementById('renew').onclick=function(){                         document.getElementById('checkcode').innerText=getcode();                     }                     //点击确定检验验证码                     document.getElementById('check').onclick=function(){                         var code=document.getElementById('checkcode').innerText;                         var inputcode=document.getElementById('inputcode').value;                         if(code != inputcode){                             window.alert("您输入的验证码不正确");                             document.getElementById('inputcode').value=''                             document.getElementById('checkcode').innerText=getcode();                             return false;                         }                     }                 }             </script>         </form>     </div>     </body> </html>  

标签:function,blue,color,9.15,验证码,var
From: https://www.cnblogs.com/0608lin/p/17705937.html

相关文章

  • 9.15
    一、java登陆界面packageloadin;//importstudent_manage.StudentManage;importjavax.swing.*;importjava.awt.*;publicclassLogin{publicstaticvoidmain(String[]args){JFramejFrame=newJFrame("登录");//JFrame可以创建一个窗口......
  • 23.9.15
    问题一:1、枚举可以使用枚举类型的取值来定义变量。在这段代码中,变量s和t都是Size类型的变量,分别引用了枚举类型Size的两个取值。2、枚举类型的比较:枚举类型的取值是对象,可以使用==运算符来比较两个枚举类型的取值是否相等。在这段代码中,s和t引用了不同的枚举类型取值,因此s==t的......
  • 9.15单链表无哨兵java实现
    publicclassMain{publicstaticvoidmain(String[]args){LNodeL=newLNode();System.out.println(L.number());L.Isempty();L.addFirst(4);//头插L.addFirst(3);L.addFirst(2);L.addFirst(1);L.a......
  • 2023.9.15 CF gym 104369 vp
    The2023GuangdongProvincialCollegiateProgrammingContesthttps://codeforces.com/gym/104369A枚举并判断即可。B注意到相邻的基站中不能有完整的区间,我们可以双指针求出最小的\(p_i\),使得\([p_i,i]\)中没有完整的区间。然后单调队列即可。C贪心,把最小的卖到最......
  • 【2023潇湘夜雨】LTSC_2021.19044.3448软件选装纯净版(9.15)
    【系统简介】=============================================================1.本次更新母盘来自LTSC_2021.19044.3448。2.增加部分优化方案,手工精简部分较多。3.OS版本号为19044.3448。精简系统只是为部分用户安装,个别要求高的去MSDN下。4.集成《DrvCeo-2.13.0.8》网卡版、运行库......
  • 9.15记
    竟然上微机课了,想了想这短暂的时间听着歌,不如写点东西吧。这周没有写任何随笔,也不知是作业太多还是什么缘故。然而我的作业也不总是完成的。班主任给我要求的班级文化墙的任务让我心里一直很担心,虽然我的职责只是分配下去并且督促,但承担这样一个并非自己所愿意承担的责任真的好难......
  • 9.15
    // An addition program import javax.swing.JOptionPane;  // import class JOptionPanepublic class Addition {   public static void main( String args[] )   {      String firstNumber,   // first string entered by user   ......
  • 9.15
    1. 原码原码就是符号位加上真值的绝对值, 即用第一位表示符号, 其余位表示值. 比如如果是8位二进制:2. 反码反码的表示方法是:正数的反码是其本身负数的反码是在其原码的基础上, 符号位不变,其余各个位取反.3. 补码补码的表示方法是:正数的补码就是其本身负数的补......
  • 9.15 1
    1.仔细阅读示例****: EnumTest.java,运行它,分析运行结果?publicclassEnumTest{       publicstaticvoidmain(String[]args){             Sizes=Size.SMALL;             Sizet=Size.LARGE;             //s和t......
  • 9.15 泛型通配符
    demo1“<?>“classMessage<T>{//定义泛型类对象privateTcontent;//泛型属性publicvoidsetContent(Tcontent){this.content=content;}publicTgetContent(){returnthis.content;}}publicclassHelloWorld{......