HTML
<input type="button" value="click" onclick="msg()"/>
CSS
JavaScript
function msg() { setTimeout( function() { alert("Welcome to Javatpoint after 3 seconds") }, 3000); }
Output