0

Display

So whenever you click the first Door i want it so my second qesution appears under the first question. I used display block and none in javascript but it doesnt seem to be working https://code.sololearn.com/WfzACEC8T03y/?ref=app

17th Aug 2022, 12:24 AM
Junior
Junior - avatar
3 Antworten
+ 3
Your Mom let blue = document.getElementById("blue").style.display = "none"; function tigerf() { if(blue.display === "none") { blue.display === "block"; } else { blue.display === "none"; } } In the above function //blue.display is wrong because of //blue = document.getElementById("blue").style.display = "none"; You should do: let blue = document.getElementById('blue'); blue.style.display = 'none'; Now if (blue.style.display === 'none) blue.style.display = 'block';
17th Aug 2022, 3:45 AM
A͢J
A͢J - avatar
+ 3
Your Mom Where is your other functions called in html?
17th Aug 2022, 3:26 AM
A͢J
A͢J - avatar
+ 3
Your Mom This is also wrong inside 'if' condition blue.display === "block"; Here === is used to compare not assign value. There should be single equal (=) for assign value.
17th Aug 2022, 3:47 AM
A͢J
A͢J - avatar