Saturday, June 1, 2024
 Popular · Latest · Hot · Upcoming
142
rated 0 times [  145] [ 3]  / answers: 1 / hits: 32291  / 14 Years ago, sat, december 11, 2010, 12:00:00

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


More From » jquery

 Answers
61

You can try something like this:



     $(document).ready(function(){

$('#moo').focus(function(){
$(this).attr('rows', '4');
});
});


where moo is your textarea.


[#94639] Thursday, December 9, 2010, 14 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
madelyn

Total Points: 449
Total Questions: 100
Total Answers: 100

Location: Seychelles
Member since Fri, May 7, 2021
3 Years ago
madelyn questions
Wed, Jul 28, 21, 00:00, 3 Years ago
Wed, Jul 14, 21, 00:00, 3 Years ago
Sat, Nov 7, 20, 00:00, 4 Years ago
Thu, Sep 3, 20, 00:00, 4 Years ago
;