Advertisement
Guest User

Untitled

a guest
Nov 27th, 2014
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 0.78 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4.     <meta charset="UTF-8">
  5.     <title></title>
  6. </head>
  7. <body>
  8.     <div class="content">
  9.         <h1>Save something</h1>    
  10.         <form action="#" method="POST">
  11.             <textarea name="content" id="content" cols="30" rows="10"></textarea>
  12.             <p><button type="submit">Send</button></p>
  13.         </form>
  14.     </div>
  15.    
  16.    
  17.    
  18.  
  19.     <script src="jquery-2.1.1.js"></script>
  20.     <script>
  21.     (function(){
  22.        
  23.        
  24.         $('form').on('submit', function(e){
  25.             $this = $(this);
  26.  
  27.             if($this.attr('method') == 'POST' && confirm('are you sure?')){
  28.                console.log('sended!');
  29.             }
  30.             e.preventDefault();
  31.         });
  32.     })();
  33.     </script>
  34. </body>
  35. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement