New course! Every coder should learn Generative AI!
Try a free lesson0
Displaying shapes
I wanted to create a code that when you clicked the button the square would appear but it doesn't seem to work. I made something like this before that worked but I deleted it. What do I need to add to my code to make it display the CSS sqaure <!DOCTYPE html> <html> <head> <title>Page Title</title> </head> <body> <button onclick="Lvl1();">LEVEL 1</button> <div id="Shape1" class="square"></div> <script> function Lvl1(){ var a = document.getElementById("Shape1"); } </script> </body> </html>
3 Answers
+ 2
Post your code here with the
"+ insert..."
text button adjacent to the post button so that anyone can figure out what going on in your code and help you out if s/he can
0
Thanks