首页
精品网站
艺术设计
网络学院
信息中心
求职招聘
网站综合
服装网站
编程开发
设计论坛
投稿
我要上榜
设计资源站
平面设计
画册
VI欣赏
包装
CG-插画
搜索
个人网页
Alexa排名
CSS
建站资源
下载专区
JS特效
品牌服装
服装院校
专题欣赏
SEO
图标欣赏
专题
域名注册
虚拟主机
广州网站设计
域名注册
广州网站建设
上海网站建设
虚拟主机
广州网页设计
签名设计
虚拟主机
域名注册
acg王国
ACG玩家
当前位置:
网站综合首页
>>
网页JS特效
>>
鼠标事件类
>> js密码强度提示代码
js密码强度提示代码
网站色彩搭配讲解
跟我探索网站排名的捷径
网页banner设计欣赏
网站装饰图标设计欣赏
设计赛事集合
ACG王国
来源:
中国设计秀
作者:
w3c
点击:
139
加入收藏
发表评论
0
顶一下
关键字:
密码
提示
代码
网站优化
码强度提示代码
代码如下,点击运行可查看效果.
<html> <head> <style> body { /*ie needs this*/ margin:0px; padding:0px; /*set global font settings*/ font-size:10px; font-family:Tahoma,Verdana,Arial; } a:hover { color:#fff; } #user_registration { border:1px solid #cccccc; margin:auto auto; margin-top:100px; width:400px; } #user_registration label { display: block; /* block float the labels to left column, set a width */ float: left; width: 70px; margin: 0px 10px 0px 5px; text-align: right; line-height:1em; font-weight:bold; } #user_registration input { width:250px; } #user_registration p { clear:both; } #submit { border:1px solid #cccccc; width:100px !important; margin:10px; } h1 { text-align:center; } #passwordStrength { height:10px; display:block; float:left; } .strength0 { width:250px; background:#cccccc; } .strength1 { width:50px; background:#ff0000; } .strength2 { width:100px; background:#ff5f5f; } .strength3 { width:150px; background:#56e500; } .strength4 { background:#4dcd00; width:200px; } .strength5 { background:#399800; width:250px; } </style> </style> <script> function passwordStrength(password) { var desc = new Array(); desc[0] = "Very Weak"; desc[1] = "Weak"; desc[2] = "Better"; desc[3] = "Medium"; desc[4] = "Strong"; desc[5] = "Strongest"; var score = 0; //if password bigger than 6 give 1 point if (password.length > 6) score++; //if password has both lower and uppercase characters give 1 point if ( ( password.match(/[a-z]/) ) && ( password.match(/[A-Z]/) ) ) score++; //if password has at least one number give 1 point if (password.match(/\d+/)) score++; //if password has at least one special caracther give 1 point if ( password.match(/.[!,@,#,$,%,^,&,*,?,_,~,-,(,)]/) ) score++; //if password bigger than 12 give another 1 point if (password.length > 12) score++; document.getElementById("passwordDescription").innerHTML = desc[score]; document.getElementById("passwordStrength").className = "strength" + score; } </script> </head> <body> <form method="post" action="" id="user_registration" name="user_registration"> <p><h1>Password strength metter</h1></p> <p> <label for="pass">Password</label><input type="password" name="pass" id="pass" onkeyup="passwordStrength(this.value)"/> </p> <p> <label for="pass2">Confirm Password</label><input type="password" name="pass2" id="pass2"/> </p> <p> <label for="passwordStrength">Password strength</label> <div id="passwordDescription">Password not entered</div> <div id="passwordStrength" class="strength0"></div> </p> <p> <input type="submit" name="submit" id="submit" value="Register"> </p> </form> </body> </html>
[Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]
2008-06-22 00:13:00 出处:
中国设计秀cnwebshow.com
本文引用地址:
http://www.cnwebshow.com/site/html/article_2344.html
热点文章/相关文章
PR值8以上的中文网站大总结
搜索优化注意的网站优化九不宜
网站优化注意:网页正文提取算法细节问题
SEO做网站请注意百度的分词技术
网站优化整体策略涉及具体内容
站点没被搜索引擎收录怎么办?
新站一月流量暴涨6000IP的后果
seo的时候请警惕你的链接
互联网人最容易犯的错误
BBS、BLOG、SNS 互联网不是谁死谁活的问题
让网站获得高流量和关注度
最新文章
·
网页效果获取鼠标点击的位置
·
js密码强度提示代码
·
动画效果鼠标点击打开/关闭层
·
跟随鼠标的弹性效果的运动图片
·
鼠标滑过图片出现大图片提示层...
·
JS特效跟随鼠标的图片
·
鼠标随移动的方向而改变
·
js特效点击会变色哦!!
·
一个表单内的多个按钮提交
·
页头下拉广告,加了关闭按钮,...
艺术设计秀最新图片
美国设计师平面设...
乌克兰平面设计作...
DeLonghi Steam I...
Simi Mahtani 杂志...
多款酒瓶包装设计...
优秀企业画册设计欣赏
推荐文章
·
网页效果获取鼠标点击的位置
·
动画效果鼠标点击打开/关闭层
·
鼠标滑过图片出现大图片提示层...
素材下载
矢量
潮流素材
背景素材
模板
网站地图
|
关于我们
|
联系我们
|
网站建设
|
广告服务
|
版权声明
|
免责声明
|
网站公告
|
友情链接
|
留言
|
旧版入口
Copyright © 2005-2008
中国设计秀_网页设计秀_艺术设计秀_网页设计教程_网站建设作品_平面设计欣赏_包装设计欣赏_品牌网站建设
All Right Reserved.
做最专业的设计服务网站,秀出自我,秀出精彩!
中国设计秀,秀---无处不在!!
交流群:9107036 3848215 8850631
粤ICP备05067046号