The positioning of the Div shouldn’t affect your event listener. Are you trying to print the innerText of the numbers into the div with the class of div? if so then it should work, I just tried it and it works for me.
It’s because the .div is at max width and height (because of the top: 0 left: 0 right etc) and it’s displayed on top of the .cont, and so you can’t click anything inside the latter one (you can check it with inspect element). You could just use the top and left property without the right and bottom so that it won’t be at full size, or you could put it below the .cont by assigning a lower z-index.
Well, the .div element covers the entirety of the screen because it has position absolute and is at position 0 in every side.
I don’t know the stacking order of html elements, but in this case the .div is layered on top of the .cont element. So, whenever you try to click a button, you are actually clicking the .div element and not the button.
I’m not very good at explaining this, so maybe someone else can give you a better answer.
Also, this might help: