I am trying to make an HTML and a JavaScript code so that after the alert(); function, then the HTML code will run.
Here is my JavaScript code:
alert("Website showing in 3, 2, 1");
And after the person clicks okay from the alert box, then my HTML code will run. How do I make the HTML code run after the JavaScript code?
class='mydiv' id='div1'
.mydiv { display:none; }
.mydiv { display:none; }
After alert()
, remove mydiv
class from your div:
document.getElementById('div1').classList.remove('mydiv');
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.