www.webdeveloper.com
Results 1 to 2 of 2

Thread: Textboxes decoration

  1. #1
    Join Date
    Dec 2011
    Posts
    39

    Textboxes decoration

    Dear Sir,

    When control enter in any textbox then following codes must run.

    Please help me what is wrong with my codes

    Code:
    <html>
    <head><title>My Contacts</title>
    
    <style type="text/css">
    body{
    margin-top:100px;
    margin-left:100px;
    }
    </style>
    
    <script type="text/javascript">
    
    $(document).ready(function(){
    	$('input[type="text"]').focus(function(){
    	$('input[type="text"]').css({
    		"background-color":"silver",
    		"font-size":"12px",
    		"color":"green"
    		});
    	 });
     });
    
    </script>
    
    
    </head>
    
    <body>
    <form>
     <input type="text" name="text1"><br />
     <input type="text" name="text2"><br />
     <input type="text" name="text3"><br />
     <input type="text" name="text4"><br />
    </form>
    
     </body>
    </html>

  2. #2
    Join Date
    Oct 2013
    Posts
    419
    Code:
    <html>
    <head><title>My Contacts</title>
    
    <style type="text/css">
    body{
    margin-top:100px;
    margin-left:100px;
    }
    </style>
    
            <script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
    
    <script type="text/javascript">
    
    $(document).ready(function(){
    	$('input[type="text"]').focus(function(){
    	$('input[type="text"]').css({
    		"background-color":"silver",
    		"font-size":"12px",
    		"color":"green"
    		});
    	 });
     });
    
    </script>
    
    
    </head>
    
    <body>
    <form>
     <input type="text" name="text1"><br />
     <input type="text" name="text2"><br />
     <input type="text" name="text3"><br />
     <input type="text" name="text4"><br />
    </form>
    
     </body>
    </html>

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles