在登录页面上,我设法捕获了自动填充功能以适应输入显示。现在,我需要验证数据本身,但是我无法获取输入值,它是空的。
<label title="signInEmailAddress" for="signInEmailAddress">
<span class="">Email</span>
<input id="signInEmailAddress" type="text" name="signInEmailAddress" required="true" />
</label>
let autoFillInputs = document.querySelectorAll('input:-webkit-autofill');
setTimeout(() => {
if (autoFillInputs) {
autoFillInputs.forEach(function(autoFillInput) {
let label = autoFillInput.closest('label');
if (label) {
label.classList.add('active');
}
setTimeout(() => {
let value = autoFillInput.value;
if (value) {
Form.validateInput(autoFillInput);
}
}, 50);
});
}
}, 500);
我如何获得价值?这些是文本输入(用户名和密码)