50projects50days/form-input-wave/script.js
2020-10-27 11:25:15 -04:00

8 lines
263 B
JavaScript

const labels = document.querySelectorAll('.form-control label')
labels.forEach(label => {
label.innerHTML = label.innerText
.split('')
.map((letter, idx) => `<span style="transition-delay:${idx * 50}ms">${letter}</span>`)
.join('')
})