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

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

#1

my code


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

#3

or the shorter version:

setTimeout(toggleModal, 3000);

#4

thank you so much your answer was super useful, regards