JQuery Tutorial 27 - basic form fields selection with an example

JQuery Tutorial 27 - basic form fields selection with an example


Code: 
<!doctype html>
<html lang="en">
<head>
 <title>JQueryexamplecode.blogspot.com</title>
   <script type="text/javascript" src="js/jquery.js"></script>
</head>
<body>
 <form action='#'>
  Name: <input type='text' /><br />
  Password: <input type='password' /><br />
  Confirm Password <input type="password" /><br />
  <input type='button' id='btnRegister' value='Register' />
 </form>
 <script>
  $(":text").focusin(function(){
   $(this).css("background-color","yellow");
  });
  $(":password").focusin(function(){
   $(this).css("background-color","yellow");
  });
  $(":text").blur(function(){
   $(this).css("background-color","white");
  });
  $(":password").blur(function(){
   $(this).css("background-color","white");
  });
  $("#btnRegister").click(function(){
   $(this).attr("value","Please wait...");
   $(this).attr("disabled",true)
  });
 </script>
</body>                                                                                    
</html>
Output:

 
Share this post :

Post a Comment

Please give your valuable feedback on this post. You can submit any ASP.NET article here. We will post that article in this website by your name.

 
Support : Ranga Rajesh Kumar
Copyright © 2012. ASP.NET Examples - All Rights Reserved
Site Designed by Ranga Rajesh Kumar