JavaScript Program to Change Background Color of Webpage Automatically After Some Delay

Write a JavaScript program to change background color of webpage automatically after some delay.



Source Code
<html>
<head>
    <title>Animate background color of webpage</title>
    <script>
        setTimeout("document.bgColor='white'", 1000)
        setTimeout("document.bgColor='lightpink'", 1500)
        setTimeout("document.bgColor = 'pink'", 2000)
        setTimeout("document.bgColor =  'deeppink'", 2500)
        setTimeout("document.bgColor = 'red'", 3000)
        setTimeout("document.bgColor = 'tomato'", 3500)
        setTimeout("document.bgColor = 'darkred'", 4000)
    </script> 
</head>
<body>
</body>
</html>
Output