📅  最后修改于: 2022-03-11 15:01:20.579000             🧑  作者: Mango
var colors = ['red', 'green', 'blue', 'orange', 'yellow'];
myDiv.style.backgroundColor = colors[Math.floor(Math.random() * colors.length)];