Popup is open or closed

hi a question, how can i know if a popup is open or closed? I want to make a validation but I do not know how to know if for example the popup is already open thanks in advance!

Hi,
vanilla js style

let p = document.getElementsByClassName('popup')
for (let i =0; i < p.length; i++){
  console.log(p[i].style.display === 'block') alert('popup opened')
}
2 Likes

Another way is to check for the modal-in class on the popup div.

2 Likes

thanks problem solved !!