Skip to content

Instantly share code, notes, and snippets.

View N-Porsh's full-sized avatar

Nikita Porshnjakov N-Porsh

  • Tallinn, Estonia
View GitHub Profile
@N-Porsh
N-Porsh / validation.js
Created June 7, 2020 09:12
Vanilla JS Reset-form validation
(function () {
let password = document.getElementById("password");
let confirmPass = document.getElementById("confirm_password");
let submit = document.getElementById("submit");
function isPasswordStrong() {
const pattern = /^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.{8,})/g;
return pattern.test(password.value);
}