Create a Modal (Popup) with HTML/CSS and JavaScript

By Florin Pop on youtube.com

More about this content:

In this tutorial we'll learn how to create a simple model with a nice transition when opening and closing. We'll target 3 elements: the open button, close button, and model container. We'll add an event listener to the open button and when it's clicked, we'll add a class of show to the model container. When the close button is clicked, we'll remove the class of show and set the opacity and pointer events back to default. We can also add a transition to the opacity so it fades in and out."