📅  最后修改于: 2022-03-11 14:53:12.201000             🧑  作者: Mango
let inputs = document.querySelectorAll('.required'),
button = document.querySelector('.button');
button.disabled = true;
for (i = 0; i < inputs.length; i++) {
inputs[i].addEventListener('input',() => {
let values = []
inputs.forEach(v => values.push(v.value))
button.disabled = values.includes('')
})
}