Javascript实现提示错误的信息直接出现在输入框后时间:2021-07-28 16:40:30可以在输入框后加个<span id="error"></span>,当验证错误时这样处理document.getElementById('error').innerText="请输入正确信息";