Adding delay and showing a message when input button clicked - Javascript jQuery

Javascript examples for jQuery:Form Button

Description

Adding delay and showing a message when input button clicked

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <script type="text/javascript" src="https://code.jquery.com/jquery-compat-git.js"></script> 
  <script type="text/javascript">
function showAlert() {//w  ww  .ja  v  a  2s .  c  o m
    setTimeout(function() {
        console.log('submitted');
    },5000);   
}

      </script> 
 </head> 
 <body> 
  <input type="button" value="Test" onclick="showAlert();">  
 </body>
</html>

Related Tutorials