Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <title></title>
- </head>
- <body>
- <div class="content">
- <h1>Save something</h1>
- <form action="#" method="POST">
- <textarea name="content" id="content" cols="30" rows="10"></textarea>
- <p><button type="submit">Send</button></p>
- </form>
- </div>
- <script src="jquery-2.1.1.js"></script>
- <script>
- (function(){
- $('form').on('submit', function(e){
- $this = $(this);
- if($this.attr('method') == 'POST' && confirm('are you sure?')){
- console.log('sended!');
- }
- e.preventDefault();
- });
- })();
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement