ใช้ Math.random() และ Math.round() สุ่มค่าสีใส่ใน document.bgColor (ลอง View Source ดูสิครับ)