Я пытаюсь установить div 'changebox' с цветом rgb, который является результатом трех рандомов. Rgbs меняются (я могу сказать по document.writes), но div просто остается белым, независимо от того, что такое rgb. Пожалуйста, помогите, чтобы коробка изменилась на правильный цвет rgb.Изменение цвета фона css с переменными javascript
<div id="changeBox" style="width: 150px; height: 150px; position: absolute; top: 10%; left: 10%; background-color: white; border: 4px solid black; color: black; font-family: 'Merriweather Sans', sans-serif;">
<script>
var randR = Math.floor(Math.random() * 255) + 1;
document.write(randR+", ");
var randG = Math.floor(Math.random() * 255) + 1;
document.write(randG+", ");
var randB = Math.floor(Math.random() * 255) + 1;
document.write(randB);
document.getElementById('changeBox').style = "background-color: rgb(" + randR + ", " + randG + ", " + randB + ");";
</script>
</div>
Спасибо, что отлично работал. – user2985562