passwordStrength 基于jquery的密码强度检测代码使用介绍

软件发布|下载排行|最新软件

当前位置:首页IT学院IT技术

passwordStrength 基于jquery的密码强度检测代码使用介绍

  2020-05-13 我要评论
查看示例:DEMO  打包下载

使用很简单。

复制代码 代码如下:

$('#pass').passwordStrength();

XHTML
复制代码 代码如下:

<p><label>请输入密码:</label>
<input type="password" id="pass" class="input" /></p>
<div id="passwordStrengthDiv" class="is0"></div>
<p><label>确认密码:</label>
<input type="password" id="repass" class="input" /></p>

注意:id#passwordStrengthDiv的DIV是用来加载强度图片的,你也可以自定义ID,但调用时就要给参数赋值:
复制代码 代码如下:

targetDiv : '#ID' //自定义加载图片的ID

载入JS和CSS:
复制代码 代码如下:

<link rel="stylesheet" type="text/css" href="style/main.css" />
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="jquery.passwordStrength.js"></script>
<script type="text/javascript">
$(function(){
$('#pass').passwordStrength();
});
</script>

Copyright 2022 版权所有 软件发布 访问手机版

声明:所有软件和文章来自软件开发商或者作者 如有异议 请与本站联系 联系我们