+ 1
Problem whit Javascript
Hi I need to change the color of "isFalse" if her value is "true" but is hard for međ const isFalse = false document.getElementById("isFalse"); if("isFalse"=="true"){ } Can you help me please??? (Im a beginner)
2 Answers
+ 7
First remove the ââ in the if statement you already declared the isFalse variable so no need to turn it into a string and true also shouldnât be a string (although itâs possible that it might work anyway as you are using == instead of ===. Still, better to get rid of the ââ and use ===).
Also, this doesnât seem right, it is unlikely that you are trying to get hold of an element with id of isFalse. You are probably trying to set isFalse to a boolean and then set an element based on this.
If you link your entire code someone will guide you further.
+ 1
Please read the following and update your question, someone can then help you more easily:
https://sololearn.com/compiler-playground/Wek0V1MyIR2r/?ref=app
https://sololearn.com/compiler-playground/W3uiji9X28C1/?ref=app