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;
}
}

最新文章

  1. 【Java每日一题】20161026
  2. selenium3各种报错解决办法
  3. openssl 证书操作命令
  4. CSS3新添加的属性
  5. 微软Sql server analysis service数据挖掘技术
  6. 关于在线查看相关开源源码的网站,包括Android源码
  7. TortoiseGit日常使用指南
  8. ownCloud Virtual Machines(bitnami.com)
  9. (待解决问题)nowrap在table和td都设置了宽度的时候仍然有效
  10. android addCategory()等说明
  11. asp.net core系列 25 EF模型配置(隐藏属性)
  12. xgboost使用
  13. CCF CSP 201403-4 无线网络
  14. nginx_log介绍和分割
  15. 利用HTML中map标签实现整张图片带有可点击区域的图像映射:
  16. Oracle数据库RowId
  17. 【ZABBIX】ZABBIX3.2升级3.4
  18. GridControl 史上最全的资料(二)
  19. Hello QT(译)
  20. 分享知识-快乐自己:Ajax 跨域请求处理

热门文章

  1. 判断List集合为空还是null的正确打开方式
  2. From 虚拟机模板 创建单节点K8S1.14.1的操作步骤
  3. [Visual Studio] - 使用 Fiddler 时,禁止监控 VSHub 请求的方法
  4. Session中清除对象方法比较
  5. springmvc流程 struts2 spring Hibernate 优缺点 使用场景介绍
  6. JDK1.8 的 HashMap 源码之文件注释
  7. Matlab R2017b 关联 .m 和 .fig 文件
  8. sublime自动格式化方法
  9. 将图片画到canvas 上的几种方法(转)
  10. 以前我对你不够好,我也很难受——CSS篇