为了账号安全,请及时绑定邮箱和手机立即绑定

表单验证

江老实 Web前端工程师
难度中级
时长57分
学习人数
综合评分9.73
197人评价 查看评价
9.8 内容实用
9.7 简洁易懂
9.7 逻辑清晰
  • 正则表达式,重复类
    查看全部
  • .msg i{display: inline-block;;vertical-align: middle;width: 25px;height: 20px;background: url(../images/sprite.png no-repat);} .msg .ati{background-position: 0 -71px;} .msg .err{background-position: 0 -39px;} .msg .ok{background-position: 0 -99px;}
    查看全部
  • form{width: 740px;height: 500px;margin: 100px auto;} form div{overflow: hidden;clear: both;} form div label{float: left;;clear: both;} form div label.text{width:152px;height:26px;padding: 0 2px ;border: 1px solid #ccc} form div label b{font-weight: normal; font-size: 12px;color: #ccc;visibility: hidden;} form div em{display:inline-block; font-size: 12px;text-align: center;color:#fff;vertical-align: middle; font-style: normal;width: 53px;height: 15px;line-height: 15px;background: #FFD099;} form div.active{background-color: #FF6600;} div span{display: inline-block;width: 80px;text-align: right;} .submitBtn{width:135px;height:33px;background: url(../images/sprite.png);color: #fff; margin: 20px 0 0 80px;} .changeImg{width: 22px;height: 22px;display: inline-block;vertical-align: middle;background: url(../images/sprite.png) no-repat 0 -128px;} .msg{line-height: 12px;color: #999;float: left;;margin-left: 5px;display:none;}
    查看全部
  • body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,th,td{margin:0; padding: 0;font: 12px/1.5"宋体","Arial","sans-serif","Tahoma";color: #666} ul,ol,li{list-style: none} img{border: none} input,select,img{vertical-align: middle;} label{vertical-align: middle;} input:focus,textarea:focus{outline: none;} .btn{border: none 0;} .mb10{margin-bottom: 10px;}
    查看全部
  • 正则字符类
    查看全部
  • <div><label><span> 会员名:</span><input type="text" class="text" ></label><p class="msg"><i class="ati"></i>5-25个字符,一个汉字为两个字符,推荐使用中文会员名</p></div> <div><label><span></span><b id="count">0个字符</b></label></div> <div><label><span>登录密码:</span><input type="password" class="text" ></label><p class="msg"><i class="err"></i>5-25个字符,一个汉字为两个字符,推荐使用中文会员名</p></div> <div><label><span></span></label></div> <div ><label><span></span><em class="active">弱</em><em>中</em><em>强</em></label></div> <div ><label><span>确认密码:</span><input type="password" class="text" ></label><p class="msg"><i class="ati"></i>请再输入一次</p></div> <div><label><span> 验证码:</span><input type="text" class="text" ><img src="images/get_img.jpg" width="100" height="30"><a class="changeImg" href="javascript:;" title="重新获取验证码"></a></label></div> <div><input type="submit" class="submitBtn btn" value="同意协议并注册"/></div>
    查看全部
  • \x00-\xff 表示单字节 replace替换
    查看全部
  • 正则表达式对象 常用test()用于判断
    查看全部
  • 选择符 或者/a|b/g
    查看全部
  • 重复类知识点{}
    查看全部
  • 字符类语法
    查看全部
  • 验证的三个状态:获取焦点onfocus,输入字符onkeyup,失去焦点onblur
    查看全部
  • 用正则表达式匹配不能全为数字和不能全为字母。注意/[^/d]/g;
    查看全部
  • 密码相同的比较方法 注:charAt(i)指定位置的字符
    查看全部
  • 字符类
    查看全部

举报

0/150
提交
取消
课程须知
1.需要具备JavaScript基础知识; 2.对HTML及CSS内容熟悉,必须的哦!
老师告诉你能学到什么?
1.您将掌握正则表达式的基本用法! 2.学会对表单如何进行验证

微信扫码,参与3人拼团

微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号

友情提示:

您好,此课程属于迁移课程,您已购买该课程,无需重复购买,感谢您对慕课网的支持!