javascript - Bgcolor not working in while loop -


although know bgcolor not best thing use change web page's color dynamically, css route not appear allow numbers bgcolor (unless mistaken). code follows:

<!doctype html> <html>   <head>     <title>title</title>     <script>       while(1===1){         confirm("you click this";)         document.write("<h1>hello</h1>");         document.bgcolor = bgcolor;       }      </script>   </head>   <body></body> </html> 

i know code in infinite loop.

can try document.body.style.background instead of document.bgcolor?

also, have ask, why need infinite loop there?


Comments

Popular posts from this blog

java - Intellij Synchronizing output directories .. -

git - Initial Commit: "fatal: could not create leading directories of ..." -