Sololearn: Learn to Code
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2
There were many errors in code ,now you can compare the following code to see what you did wrong window.onload=function(){ document.getElementById("btn").addEventListener("click", function(){ var box=document.getElementsByClassName("box"); if(box[0].style.display=="none") { box[0].style.display="block"; } else { box[0].style.display="none"; } }); }
28th May 2020, 9:46 AM
Abhay
Abhay - avatar
+ 5
Would help a bit if you provided a link to your code...
28th May 2020, 9:38 AM
Kuba Siekierzyński
Kuba Siekierzyński - avatar