On my website, I have a 'click to open chat button' on the bottom right of the website. I do not know if this is possible, but I would like to turn a DIV circle green (Online Status) monday to friday 9-5pm UK TIME.
/
SO BASICALLY at the moment, my javascript only detects the weekend. Monday- Friday, the button will turn green. How would I set the time aswell?
var div = document.getElementById('onlineStatus');
div.style.backgroundColor = 'green';
var today = new Date();
if(today.getDay() == 6 || today.getDay() == 0) div.style.backgroundColor = 'red';
.onlineStatus {
height: 20px;
width: 20px;
background-color: green;
border-radius: 50%;
display: inline-block;
}
<span class="onlineStatus" id="onlineStatus"></span> Click to contact us now!