📜  密码和确认密码验证js - Javascript代码示例

📅  最后修改于: 2022-03-11 15:02:35.460000             🧑  作者: Mango

代码示例2
var check = function() {
  if (document.getElementById('password').value ==
    document.getElementById('confirm_password').value) {
    document.getElementById('message').style.color = 'green';
    document.getElementById('message').innerHTML = 'matching';
  } else {
    document.getElementById('message').style.color = 'red';
    document.getElementById('message').innerHTML = 'not matching';
  }
}