How do I change the background color with JavaScript?

后端 未结 19 2642
春和景丽
春和景丽 2020-11-22 13:59

Anyone know a simple method to swap the background color of a webpage using JavaScript?

19条回答
  •  被撕碎了的回忆
    2020-11-22 14:51

    I wouldn't really class this as "AJAX". Anyway, something like following should do the trick:

    document.body.style.backgroundColor = 'pink';
    

提交回复
热议问题