Skip to content

Latest commit

 

History

History
12 lines (9 loc) · 585 Bytes

README.md

File metadata and controls

12 lines (9 loc) · 585 Bytes

Modal With HTML, CSS & JavaScript

Steps

  1. Get the Modal, the button of the Modal and the close button with getElementsByClassname and getElementById
  2. Add a click event listener using addEventListener, so when you click on the button, it will show the Modal.
  3. Create an openModal() function that changes the Modal display value to 'block'
  4. Add a click event listener for closing the Modal
  5. Create a closeModal() function that changes the Modal display value to 'none'
  6. Hide the Modal when clicking outside of the Modal window

Modal