As commented this is not the most correct to do because when you get the time with javascript, you get the time of the user/client computer, but answering your question, you could do so:
In html:
<div class="Lojas">
<p class="Loja">Loja 1</p>
<p class="Horario" data-open="8" data-close="18">Aberto Todos os dias das 8:00 as 18:00</p>
</div>
<div class="Lojas">
<p class="Loja">Loja 2</p>
<p class="Horario" data-open="10" data-close="20">Aberto Todos os dias das 10:00 as 20:00</p>
</div>
jQuery:
var agora = new Date();
var horario = agora.getHours();
$(".Horario").each(function(){
var open = $(this).data("open");
var close = $(this).data("close");
var span = document.createElement("span");
if(horario >= open && horario <= close){
span.innerHTML = "ABERTO";
}else{
span.innerHTML = "FECHADO";
}
$(this).parent().append(span);
})
See an example here:
https://jsfiddle.net/j8hhhquw/
Only in JS/jQuery have to be careful, as it cannot depend on the client’s PC. If the pc’s time is wrong, the information shown will also be. The ideal would be something with server side aid.
– Bacco