How could I add time delay to this pop up and make it open automatically by itself without any click?

my code

    setTimeout(function() {
      toggleModal();
    }, 3000); // waits 3 seconds after page loads and then toggles the modal
1 Like

or the shorter version:

setTimeout(toggleModal, 3000);
1 Like

thank you so much your answer was super useful, regards