DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Titletitle>
<style>
span{
width: 100px;
height: 15px;
display: inline-block;
style>
head>
<body>
<input type="text">
<span class="">span>
<script>
document.querySelector("input").onblur = function (){
this.nextElementSibling.innerHTML = (/^(\w|-){6,16}$/.test(this.value)) ? "正确" : "错误";
}
script>
body>
html>
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)