Skip to content

Instantly share code, notes, and snippets.

@Avotrix
Created June 17, 2020 23:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Avotrix/d06b98a4d1df1aeda02aa4c6bd8ccb27 to your computer and use it in GitHub Desktop.
Save Avotrix/d06b98a4d1df1aeda02aa4c6bd8ccb27 to your computer and use it in GitHub Desktop.
airqualitycheck6
z= parseFloat(this.responseText);
//--------Fresh air COndition----------------------------------------------------
if(z<500){
document.getElementById("ColorButton").style.backgroundColor="limeGreen";
document.getElementById("ColorButton").value="Fresh Air" }
//-----Moderate air COndition----------------------------------------------------
else if(z>500 && z<1000){
document.getElementById("ColorButton").style.backgroundColor="Gold";
document.getElementById("ColorButton").value="Moderate Air";
}
//--------Polluted air Condition----------------------------------------------------
else if(z>1000){
document.getElementById("ColorButton").style.backgroundColor="red";
document.getElementById("ColorButton").value="Polluted Air"; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment