<a href="javascript:doStuff()">Do Stuff</a>
async function sleep(fn, ms) {
await new Promise(resolve => setTimeout(resolve, ms))
fn()
}
async function doStuff() {
await sleep(validateEmail, 1500)
await sleep(validateEmail, 1500)
await sleep(validateEmail, 1500)
document.body.innerHTML += '<hr>'
}
function validateEmail() {
document.body.innerHTML += '<br>'+new Date().getTime()
}
View Compiled
This Pen doesn't use any external CSS resources.