//获取16进制颜色值
let randomColor = () =>`#${Math.floor(Math.random()*0xffffff).toString(16)}`
//把randomColor函数作为参数传给document.body.style.backgroundColor
document.body.style.backgroundColor = randomColor()
获取随机16进制颜色值
最新推荐文章于 2024-08-27 16:46:18 发布