On a div, with CSS, I'm trying to update its background color with a change in a database in Firebase. This update I only see if I refresh in the browser. I would like the corresponding div to be updated since the change was made in Firebase. Attached codes:
Here I make the class changes:
function changeColor(colorChange) {
if ((colorChange == 1) || (colorChange == 11)){
document.getElementById('Asiento7').classList.remove('blink','flash');
document.getElementById('Asiento7').classList.add('Busy');
}
Previous changes are made by reading from the database:
var databaseEstado = firebase.database().ref('CubiculosIndividuales/Asiento1/status');
databaseEstado.once("value", function(snap){
status = snap.val();
changeColor(status);
});