I am making an application that simulates a point marker, and I would need it to increment the next marker only after 5 minutes, I did some tests with setTimeout , but I did not get what I needed. The application makes the markings but does not have the 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>