How to change the number of rows in the textarea using jQuery

I have a textarea with 5 lines. I want to show only one line and on focus it should show remaining 4 lines.


You can try something like this:


        $(this).attr('rows', '4');

where moo is your textarea.


Or, using less jQuery, less typing, and getting a hair more performance:

    .focus(function(){ this.rows=5 })
    .blur( function(){ this.rows=1 });

Try this

       $(this).animate({'height': '185px'}, 'slow' );//Expand the textarea on clicking on it
       return false;

Need Your Help

Why would you want to put an index on a view?

sql sql-server database-design indexing

Microsoft SQL Server allows you to add an index to a view, but why would you want to do this?

Get all of the Classes in the Classpath

java reflection class

How can I get list of all available classes in CLASSPATH at runtime?