1
I am making an application that simulates a point marker, and I would need it to increase the next mark only after 5 minutes, I did some tests with setTimeout, but I didn’t get what I needed. The application makes the appointments, but does not have the time timer(5 minutes).
js:
var qtd = document.getElementById("dataTime");
function getTime(){
var data = new Date();
var full_time = data.getHours() + ":" + data.getMinutes() + ":" + data.getSeconds();
var dataCompleta = full_time;
while (qtd < 4){
document.getElementById("horaMarcada").insertAdjacentHTML('beforeend', '<span id="dataTime">'+ dataCompleta +' </span>');
qtd++;
return false;
}
}
html:
<button onclick="getTime()">Marcar</button>
it would not be better if you save the time in the database and go checking the difference with the setTimeout? so it would be more reliable and safer for your application.
– Diego Braga
at first I want to save the tags with localStorage
– josecarlos
You want 3 marks or 4?
– Sam
4 appointments, the first in the act and the other 3 only after 5 minutes, if the person clicks before 5 minutes I will present a message saying that only after 5 minutes
– josecarlos
Obs: and the other 3, each only after 5 minutes
– josecarlos