<script>
var change = document.getElementById("meBaby");
function getRandomColor() {
var letters = '0123456789ABCDEF';
var color = '#';
for (var i = 0; i < 6; i++) {
color += letters[Math.floor(Math.random() * 16)];
}
return color;
}
function getRandomGradient() {
return 'linear-gradient('+(Math.random()*360)+'deg, '+getRandomColor()+' 0%, '+getRandomColor()+' 100%)';
}
function changeColor() {
change.style.background = getRandomGradient();
}
changeColor();
setInterval(changeColor, 1000);
</script>
<html>
<div id="meBaby">TEST</div>
</html>
CR.
https://stackoverflow.com/questions/56430687/how-to-use-a-function-to-change-background-color-with-linear-gradient