Simple alarm Java script for testing help
I made the time to appear on the screen all right and such, but I created two field boxes (input) and a submit. I want to take these values that the user types and compare it with the current date and time and when he gives the time he gives an alert just to test it function mostreHora() { var d = new Date(); var hora = d.getHours(); var min = d.getMinutes(); var sec = d.getSeconds(); var div = document.getElementById(“relogio”); div.innerHTML = "<h3>" + hora + ":" + min + ":" + sec + "</h3>"; function alarme(){ var horaAlarme = document.getElementById("hora").value; var minutoAlarme = document.getElementById("minuto").value; if (hora == horaAlarme && min == minutoAlarme && sec == 0) { alert("Alarme Tocando!!!"); } } setInterval(mostreHora, 1000);