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

前端 未结 3 1874
南笙
南笙 2020-12-09 08:59

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

3条回答
  •  萌比男神i
    2020-12-09 09:46

    Try this

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

提交回复
热议问题