How to change the number of rows in the textarea using jQuery
jQuery(function($){
$('#foo').focus(function(){
$(this).attr('rows',5);
}).blur(function(){
$(this).attr('rows',1);
});
});
Or, using less jQuery, less typing, and getting a hair more performance:
jQuery(function($){
$('#foo')
.focus(function(){ this.rows=5 })
.blur( function(){ this.rows=1 });
});
You can try something like this:
$(document).ready(function(){
$('#moo').focus(function(){
$(this).attr('rows', '4');
});
});
where moo is your textarea.