jquery判断两次密码不一致
jquery检测输入密码两次不一样提示
输入密码: <input type="password" name="password1" id="password1"/>
确认密码: <input type="password" name="password2" id="password2" onkeyup="validate()"/>
<span id="tishi"></span>
<input type="submit" value="注册" id="submit"/>
js部分
function validate() {
var password1 = document.getElementById("password1").value;
var password2 = document.getElementById("password2").value;
if(password1 == password2) {
document.getElementById("tishi").innerHTML="<font color='green'>两次密码相同</font>";
document.getElementById("submit").disabled = false;
}
else {
document.getElementById("tishi").innerHTML="<font color='red'>两次密码不相同</font>";
document.getElementById("submit").disabled = true;
}
}
最新文章
- 【Java每日一题】20161026
- selenium3各种报错解决办法
- openssl 证书操作命令
- CSS3新添加的属性
- 微软Sql server analysis service数据挖掘技术
- 关于在线查看相关开源源码的网站,包括Android源码
- TortoiseGit日常使用指南
- ownCloud Virtual Machines(bitnami.com)
- (待解决问题)nowrap在table和td都设置了宽度的时候仍然有效
- android addCategory()等说明
- asp.net core系列 25 EF模型配置(隐藏属性)
- xgboost使用
- CCF CSP 201403-4 无线网络
- nginx_log介绍和分割
- 利用HTML中map标签实现整张图片带有可点击区域的图像映射:
- Oracle数据库RowId
- 【ZABBIX】ZABBIX3.2升级3.4
- GridControl 史上最全的资料(二)
- Hello QT(译)
- 分享知识-快乐自己:Ajax 跨域请求处理
热门文章
- 判断List集合为空还是null的正确打开方式
- From 虚拟机模板 创建单节点K8S1.14.1的操作步骤
- [Visual Studio] - 使用 Fiddler 时,禁止监控 VSHub 请求的方法
- Session中清除对象方法比较
- springmvc流程 struts2 spring Hibernate 优缺点 使用场景介绍
- JDK1.8 的 HashMap 源码之文件注释
- Matlab R2017b 关联 .m 和 .fig 文件
- sublime自动格式化方法
- 将图片画到canvas 上的几种方法(转)
- 以前我对你不够好,我也很难受——CSS篇