30 likes | 103 Views
Manipulating Focus on input boxes. <!DOCTYPE html> <html> <head> <script src ="D:/C2y/jquery-1.9.1.min.js"> </script> <script> $(document).ready(function(){ $("input").focus(function(){ $(this). css ("background-color","# cccccc "); }); $("input").blur(function(){
E N D
<!DOCTYPE html> <html> <head> <script src="D:/C2y/jquery-1.9.1.min.js"> </script> <script> $(document).ready(function(){ $("input").focus(function(){ $(this).css("background-color","#cccccc"); }); $("input").blur(function(){ $(this).css("background-color","#ffffff"); }); }); </script> </head> <body> Name: <input type="text" name="fullname"><br> Email: <input type="text" name="email"> </body> </html>
Slide toogle • <!DOCTYPE html> • <html> • <head> • <script src="D:/C2y/jquery-1.9.1.min.js"> • </script> • <script> • $(document).ready(function(){ • $("#flip").click(function(){ • $("#panel").slideToggle("slow"); • }); • }); • </script> • <style type="text/css"> • #panel,#flip • { • padding:5px; • text-align:center; • background-color:#FF6600; • border:solid 1px #c3c3c3; • } • #panel • { • padding:50px; • display:none; • } • </style> • </head> • <body> • <div id="flip">Click to slide the panel down or up</div> • <div id="panel">Hello world!</div> • </body> • </html>