How can I change the font color of all texts of your website using Javascript?

前端 未结 3 1789
滥情空心
滥情空心 2021-01-29 10:37

I learned, that there are ways to change the color of single texts. However I\'d like to find out how to change the color of all texts of my website at one time.

I foun

3条回答
  •  生来不讨喜
    2021-01-29 11:14

    Use .color instead of using .backgroundColor.

    document.body.style.color = "red";
    This is text that will change colors!

    As stated in the comments above, you should really think about using CSS like this:

    body{
      color:red;  
    }
    This is text that will change colors!

提交回复
热议问题