k = document.querySelector('input[name=nick]'); const reg = /^[A-Za-z0-9\u4e00-\u9fa5]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/; if (!email.value || !nick.value || !reg.test(email.value)) { const str = `
请填写正确的昵称和邮箱!
`; const vmark = document.querySelector('.vmark'); vmark.innerHTML = str; vmark.style.display = 'block'; setTimeout(function() { vmark.style.display = 'none'; vmark.innerHTML = ''; }, 2500); } } });