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

How to access named pipes using JavaScript in Firefox add-on? -

multithreading - OPAL (Open Phone Abstraction Library) Transport not terminated when reattaching thread? -

node.js - req param returns an empty array -