dauzcode

form

Aug 14th, 2012
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
jQuery 0.77 KB | None | 0 0
  1. <!DOCTYPE HTML>
  2. <html lang=en>
  3. <head>
  4.     <title>Belajar Jquery dan Ajax</title>
  5.     <style type="text/css">
  6.  
  7.     </style>       
  8. </head>
  9. <body>
  10.     <form action="#">
  11.         <p>Name: <br /><input type="text" /></p>
  12.         <p>Email: <br /><input type="text" /></p>
  13.         <p><input id="newsletter_button" type="button" value="Sign up" /></p>
  14.     </form>
  15.    
  16.     <script type="text/javascript" src="jquery.js"></script>
  17.     <script type="text/javascript">
  18.         $(':text').focusin(function(){
  19.          $(this).css('background-color', 'yellow');
  20.    
  21.         });
  22.            
  23.        $(':text').blur(function(){
  24.          $(this).css('background-color', '#fff');
  25.  
  26.        });
  27.  
  28.        $(':button').click(function(){
  29.         $(this).attr('value', 'Mohon tunggu....');
  30.         $(this).attr('disable', true);
  31.        }); 
  32.     </script>  
  33. </body>
  34. <html>
Advertisement
Add Comment
Please, Sign In to add comment