Advertisement
Guest User

timer

a guest
Jan 26th, 2017
3,245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <html lang="en-US">
  2. <head>
  3. <script src="jquery-1.9.1.min.js"></script>
  4.           <script type="text/javascript">
  5.         $(document).ready(function(){
  6.                 $("#simpan").click(function(){             
  7.                     $("#simpan").hide();               
  8.                     $("#timer").show();            
  9.                 });
  10.         });
  11.       </script>
  12.       <script type="text/javascript">
  13.         $(document).ready(function(){
  14.         $("#simpan").click(function(){ 
  15.         var detik = 10;    
  16.        
  17.         function hitung(){
  18.         var to = setTimeout(hitung,1000);
  19.          var peringatan = 'style = "color: red"';        
  20.          $('#timer').html( '<h1 align="center" '+peringatan+'>Please Wait<br />'+detik+'</h1>' );
  21.          detik --;
  22.          if(detik < 0){
  23.          clearTimeout(to);
  24.          detik = 10;
  25.         $("#timer").hide();            
  26.         $("#simpan").show();
  27.          }
  28.          }
  29.          hitung();
  30.          });
  31.          });
  32. </script>
  33. </head>
  34. <body>
  35. <center>
  36. <form action="">
  37. User : <input type="text" /><br /><br />
  38. Password : <input type="text" /><br /><br />
  39. status : <input type="text" /><br /><br />
  40. <input type="button" value="Submit" id="simpan" />
  41. <div id="timer" style="display:none;"></div>
  42. </form>
  43. </center>
  44. </body>
  45. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement