由于某种原因,这不会使“errorJS” div 可见。有人可以帮帮我吗?
function checkLogin()
{
document.getElementById("errors").style.display = "none";
var form = document.getElementById("form1");
var problems = false;
document.getElementById("errorJS").innerHTML = "";
if(form.email.value.length < 1)
{
document.getElementById("errorJS").innerHTML += "Please enter your email address. <br />";
problems = true;
document.getElementById("errorJS").style.display = "box";
}
if(form.pword.value.length < 1)
{
document.getElementById("errorJS").innerHTML += "Please enter your password.";
problems = true;
alert(document.getElementById("errorJS").style.display);
document.getElementById("errorJS").style.display = "box";
}
return !(problems);
}
愚蠢的我,我不敢相信我犯了这个错误。我一直在编码太多的连续时间。感谢大家的回答。