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

jQuery Mobile app not scrolling in Firefox -

c++ - How to add Crypto++ library to Qt project -

php array slice every 2th rule -