first of all my english is not really good.
I want to write a script in HTML where i can make a login access between 21:00 (9 PM) till 6:00 AM.
function myFunc() {
var today = new Date();
var h = today.getHours();
var stunde = [21, 22, 23, 1, 2, 3, 4, 5, 6];
var s1 = document.getElementById("field1").value;
var s2 = document.getElementById("field2").value;
if (h == stunde) {
if (s1 == s2) {
if (s1 != '' && s2 != '') {
window.location.href = 'default.html';
}
} else window.alert("Veuillez insérer les données correctement.");
}
}
Is my If-Statement not correct? Maybe should i use a for(; ;)?
Thanks for considering my request :)
\o/