I have been working on a project for about 5 days, and wanted to make a button which would give a delay of 2 seconds before triggering the event. I need help, please :(
5/10/2020 11:22:02 PM
document.querySelector('button').addEventListener("click",() => setTimeout(yourFunctionName, 2000))
Teddy Alejandro Moreira Vélez Hey check this code :)) The alert will be shown after 2 seconds.
Learn Playing. Play Learning
Send us a message