@Grego14
Posted
Hello! I have been reading your code and here are some recommendations:
When you click the dimiss button you are changing the display property of the card to block when you should change it to its initial state flex, otherwise it causes overflows.
I also recommend that you read a little about event delegation, so that you don't have to use two eventListeners to handle the buttons and just one. Event Delegation Example.
Something like this:
document.addEventListener("submit", e => {
e.preventDefault();
if(e.target === subscribe){
/* ... */
}else if(e.target === dismiss){
/* ... */
}
});
I hope this helps!
Marked as helpful