博主网站(未完善)
博主首页

目录

01图标库
02插件安装

01条件渲染
02列表渲染
03模板渲染
04计算属性
05侦听器
06样式绑定
07样式
08事件
09表单输入绑定
10生命周期
11组件
12脚手架
13vue-router
14vuex
15拖拽
16组件间传递

01HTML元素
02CSS样式

01filter、find……
02匿名函数……
03动态拼接地址
04vh、vm
05vue中ref
06js类型判断
07插槽
08富文本编辑器
09javaScript
10watch监听
11依赖注入
12ES6运算符
13flex-direction
14本地存储
15随机颜色
16中间延申
17多次触发问题
18nvm安装
19表单数据动态
20持久化存储
21$nextTick
22::v-deep
23tab失灵
25封装表单验证
26电梯导航栏
27页面滚动渐入动画

css3基础01

01bs列表
02bs栅格
03bs表单
更新中......

其他---01js密码强度实例

<!DOCTYPE html>
<html lang="zh">
<head>
	<meta charset="UTF-8" />
	<meta name="viewport" content="width=device-width, initial-scale=1.0" />
	<meta http-equiv="X-UA-Compatible" content="ie=edge" />
	<title>Document</title>
	<style type="text/css">
		*{
			margin:0;
			padding:0;
		}
		html,body{
        height: 100%;
    }
    body{
        display: flex;/*(笔记里面有)*/
        align-items: center;
        align-content: center;
    }
		#password{
			display:inline-block;
			padding:5px 20px;
			border:1px solid red;
			color:#333;
			margin:0 auto;
		}
		#password>p{
			font-size:12px;
			color:#888;
		}
		.tips{
			display:inline-block;
			padding:3px 8px;
			border:1px solid #b9b8b8;
			margin-right:10px;
			border-radius:30px;
		}
	</style>
</head>
<body>
	<div id="password">
		密码:<input type="password" value=""/>
			<p>
				密码强度:
				<sapn class="tips"></sapn>
				<sapn class="tips"></sapn>
				<sapn class="tips"></sapn>
				<sapn class="tips"></sapn>
				<span class="tips"></span>
			</p>
	</div>
<script type="text/javascript">
function matchLevel(password){
	if(password.length<6){
		return 0;
	}
	else if(password.length>=6&&password.length<10){
		return 1;
	}
	else if(password.length>=10&&password.length<16){
		return 2;
	}
	else if(password.length>=16&&password.length<20){
		return 3;
	}
	else{
		return 4;
	}
}
	window.onload=function(){
		tipColor=['red','yellow','orange','green','blue'];
		var tipEle=document.getElementsByClassName("tips");
		document.getElementsByTagName("input")[0].onkeyup=function(){
			var level=matchLevel(this.value);
			if(this.value.length){
				for(var i=0,eleLen=tipEle.length;i<eleLen;i++){
					if(i<=level){
						tipEle[i].style.backgroundColor=tipColor[i];
					}else{
						tipEle[i].style.backgroundColor="";
					}
				}
			}
			else{
				for(var i=0,eleLen=tipEle.length;i<eleLen;i++){
					tipEle[i].style.backgroundColor="";
				}
			}
		}
	}
</script>
</body>
</html>

  

posted @ 2020-06-03 21:11  !ment  阅读(236)  评论(0编辑  收藏  举报