50projects50days/password-strength-background/script.js
2020-10-07 11:50:17 -04:00

10 lines
306 B
JavaScript

const password = document.getElementById('password')
const background = document.getElementById('background')
password.addEventListener('input', (e) => {
const input = e.target.value
const length = input.length
const blurValue = 20 - length * 2
background.style.filter = `blur(${blurValue}px)`
})