Modal (Popup) using HTML/CSS and JavaScript

Published: 14 November 2021
on channel: Pythonology
343
5

In this video you will learn how to make a modal popup with html, css, and Javascript. It is a beginner javascript tutorial.
Support the channel:
https://www.buymeacoffee.com/vahidnia
--------
The JS code:
const pop = document.querySelector('.pop')
const x = document.querySelector('.x')
const modal = document.querySelector('.modal')
const overlay = document.querySelector('.overlay')

const open = function(){
modal.classList.remove('hidden');
overlay.classList.remove('hidden');
}

pop.addEventListener('click', open)


const close = function(){
modal.classList.add('hidden');
overlay.classList.add('hidden');
}

x.addEventListener('click', close);
overlay.addEventListener('click', close)


Watch video Modal (Popup) using HTML/CSS and JavaScript online, duration hours minute second in high quality that is uploaded to the channel Pythonology 14 November 2021. Share the link to the video on social media so that your subscribers and friends will also watch this video. This video clip has been viewed 343 times and liked it 5 visitors.