Displaying shapes | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

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>

5th Dec 2017, 7:41 PM
Zakariya
Zakariya - avatar
3 Answers
5th Dec 2017, 8:34 PM
Ranjan Bagri
Ranjan Bagri - avatar
+ 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
5th Dec 2017, 8:27 PM
Nomeh Uchenna Gabriel
Nomeh Uchenna Gabriel - avatar
0
Thanks
5th Dec 2017, 8:36 PM
Zakariya
Zakariya - avatar