DEV Community

Discussion on: Why are these codes not working?

Collapse
pavelloz profile image
Paweł Kowalski

Sure thing, here you have working minimal example :)

codepen.io/pavelloz/pen/YzZXzXR?ed...

I dont think you need display function at all, but since you do, you need to execute it, so evrything inside (including attaching event listeners) occur.