50projects50days/form-input-wave/script.js

8 lines
263 B
JavaScript
Raw Normal View History

2020-10-27 15:25:15 +00:00
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('')
})