Created
June 17, 2020 23:10
-
-
Save Avotrix/d06b98a4d1df1aeda02aa4c6bd8ccb27 to your computer and use it in GitHub Desktop.
airqualitycheck6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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