Last updated on November 23rd, 2022 at 01:47 pm

This tutorial is moved to how to loop/cycle background color using Javascript automatically

13 thoughts on “How to change webpage background color using javascript”
  1. Hi, my friend showed me that you can use javascript to change things in your browser by doing stuff like javascript:”Hi” and that, but I forgot how to change the background color, not of your website, but turn your browser window into a solid color. Help, please?

    1. Hello Alan,
      Thanks for your comment, Please check now, I have made the code much easier for copy paste.[Previously some extra character was popping up while copying and that might prevented the code from working, fixed it]
      Please let me know if you have any issues.

  2. Nice information. I like it. Thank

  3. Hello, I find your article useful… However I also need to change the font color along with the background color & also I wonder if you can change the bg color for other div within the same page as well… Is there a way to do that? Thanks. 🙂

    1. Hello,
      Thanks for your comment.
      Yes you can do that by using this attribute document.getElementById(‘YOUR DIV NAME’).style.backgroundColor = “YOUR COLOR”

  4. Thank you for this tutorial.

    How would this be done by having only one link that cycles through several background colours?

    Thanks!
    Takashi

  5. i have done web development long ago, but now have a friend who is color blind, and i am wondering if there is any way to change colors/text from the user side

    thankx

Leave a Reply

Your email address will not be published. Required fields are marked *