To make a number label in the top left of the screen, we can create a div element and add some CSS styles to position it in the top left corner. We can also set the initial value of the number label to 0.
index.tsx221 chars7 lines
To create a square in the center of the screen, we can also create a div element and add some CSS styles to position it in the center. We can also add an event listener that increments the number value by 1 every time it's clicked.
index.tsx436 chars14 lines
Finally, we can add both elements to the HTML body using the appendChild()
method.
index.tsx75 chars3 lines
gistlibby LogSnag