<body> <script> var r = (Math.random() * 255).toFixed(), g = (Math.random() * 255).toFixed(), b = (Math.random() * 255).toFixed(); document.body.style.background = 'rgb(' + [r, g, b] + ')'; </script> </body>