skip to Main Content

how to use javascript to change background color on condition

hi everyone i'm new so please be nice:) --edit 2: so this is what im onto now colorChange: function(data) { console.log(data.main.temp); var tempColor= this.displayWeather(document.querySelector(data.main.temp).value); if(tempColor<=10){ document.body.style.backgroundColor="lightgrey"; } else if(tempColor>=11&&tempColor<20){ document.body.style.backgroundColor="lightblue"; } else{ document.body.style.backgroundColor="lightcoral"; } } it seems the issue is…

VIEW QUESTION
Back To Top
Search