当前位置: 首页 > 后端技术 > Node.js

JS使用模块化实现用户名密码检测、密码强度验证、验证码生成

时间:2023-04-03 14:16:37 Node.js

html页面用户名:
密码:
>密码强度:
验证码:
JS代码块varmodule=(function(){vartestSpan,msg,Slength,userpwd,userpwd,yzm;functionprint(msg){alert(msg);};//弹出消息框//简单验证码函数createyzm(testSpan,Slength){varstr="0123456789qwertyuioplkjhgfdsazxcvbnmQWERTYUIOPLKJHGFDSAZXCVBNM";varlist=str.split("");for(i=0;i