    if (newPassword.value != confirmPassword.value) {
              confirmPassword.setCustomValidity('Passwords do not match');
              confirmPassword.style.color = 'red';
              confirmPassword.previousElementSibling.style.color = 'red';
          } else {
              confirmPassword.setCustomValidity('');
              confirmPassword.style.color = 'black';
              confirmPassword.previousElementSibling.style.color = 'black';
          }
      }); 
   </script>
</html>