Saturday, 7 May 2016

How to Auto Resize a textarea html field by jQuery

This one more post on Web Development using JQuery, in this post we will discuss on auto resize of a html textarea field by using jquery. When user start type in html textarea element then it will automatically increase it's height very smoothly and when user will leave from textarea field it will automatically reduce the height smoothly and comes to it's orignal height. This all things are done by using jquery. By using jquery we can change the height of this fields. If you have use facebook and in facebook you have try type in textarea it was automatically change the height. If you want to give somethings new to your user then you can add this type of features in your web application. If you want to learn in details, you can see the video of this post.

Source Code

 <!DOCTYPE html>  
           <title>Webslesson Tutorial | How to Auto Resize a textarea with jQuery</title>  
           <script src=""></script>  
                margin:0 auto;  
                border:1px solid #dddddd;  
                     $(this).animate({"height":"100px",}, "fast");  
                     $(this).animate({"height": "40px",}, "fast" );  
           <div class="wrapper" align="center">  
                <br />  
                <h3>How to Auto Resize a textarea with jQuery</h3><br />  
                <textarea name="resize" class="resize"></textarea>  
                <br />