Js随机颜色值选取
2021-06-09 13:05
阅读:600
标签:tco blog get rar for elements span logs dom Js随机颜色值选取 标签:tco blog get rar for elements span logs dom 原文地址:http://www.cnblogs.com/moonlignt/p/7299637.html
function getColor(){
var colorElements = "0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f";
var colorArray = colorElements.split(",");
var color ="#";
for(var i =0;i){
color+=colorArray[Math.floor(Math.random()*16)];
}
return color;
}
评论
亲,登录后才可以留言!