background colour conditions

master
louisa 2 years ago
parent e4bbac2a88
commit 543b477cca

@ -19,23 +19,17 @@
// Split the data into separate parts
const [node, value] = data.split(' ');
if (node === 'node3' && value === '15') {
// Change the background color to red
document.body.style.backgroundColor = 'red';
}
if (node === 'node4' && value === '21') {
} else if (node === 'node4' && value === '21') {
// Change the background color to blue
document.body.style.backgroundColor = 'blue';
}
else {
} else {
// Restore the default background color
document.body.style.backgroundColor = 'white';
document.body.style.backgroundColor = rgb(26, 26, 26);
}
});
});
function sendMessage() {
const inputField = document.getElementById('input');
const message = inputField.value;

Loading…
Cancel
Save