我真的什么都试过了。我不知道该怎么办。它不工作
function load() {
if(acc == "a")
var d = document.getElementById('sn');
d.style.display='block';
var b = document.getElementById('neas');
b.style.display='none';
if(acc == "n")
var d = document.getElementById('sn');
d.style.display='none';
var b = document.getElementById('neas');
b.style.display='block'; }
我的头:
<script language="JavaScript">
day = new Date();
hour = day.getHours();
if (hour>=3 && hour<2)
acc = "a";
else { acc = "n"; }
</script>
<script language="JavaScript">
function load() {
var d = document.getElementById('sn');
var b = document.getElementById('neas');
if(acc == "a") {
d.style.display='block';
b.style.display='none';
} else if(acc == "n") {
d.style.display='none';
b.style.display='block';
}
}
</script>
我的身体:
<input type="password" maxlength="20" id="sn" style="width: 180px; height: 25px; background-image: url(bginput.gif); border:0; padding-left: 5px; padding-right: 5px; color: #0099cc; text-align: center;" value="">
<input type="text" id="neas" style="width: 180px; height: 25px; background-image: url(bginput.gif); border:0; padding-left: 5px; padding-right: 5px; color: #0099cc; text-align: center;" value="You are unable to enter." readonly>
对不起,愚蠢的问题,我只是JS的初学者。