📜  javascript 密码最大长度 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:15.958000             🧑  作者: Mango

代码示例1
let pass = document.getElementById('pass-one');
    let count = document.getElementById('counter');
    let maxLength = 10;
    pass.setAttribute('maxlength', maxLength);
    pass.addEventListener('input', () => {
        count.innerText = `${pass.value.length}/${maxLength}`;
    })