<html> <head> <style> body{ transition: 2s; } </style> </head> <body> <script> setInterval(()=> document.body.style.backgroundColor= '#'+Math.floor(Math.random() * 4095).toString(16), 2000); </script> </body> </html>
<html> <head> <style> body{ transition: 2s; } </style> </head> <body> <script> (bgc =()=> { document.body.style.backgroundColor= '#'+Math.random().toString(16).slice(2,8); setTimeout(bgc, 2000); })(); </script> </body> </html>