创建随机颜色的函数 发表于 2017-08-28 | 分类于 coding 12345678function getRandomColor(){ var colorArr = ['1','2','3','4','5','6','7','8','9','A','B','C','D','E','F']; var color = ""; for(var i = 0; i < 6; i++){ color += colorArr[Math.floor(Math.random()*16)]; } return "#"+color;}