I want to get the scrollheight of  <textarea>  when people changing the content.The problem is when I add the content ,I can get a growing scrollheight ,but when I delete contents,I can't get a Reduced scrollheight。And here is the code
$("textarea[id^='_sub_ialready_']").live("keydown keyup focus blur",
    function()
    {
        if(aobj.minHeight == 0)
        aobj.minHeight = $(this).height();
        if($(this).attr("scrollHeight") > aobj.minHeight)
        {
            if($(this).attr("scrollHeight") > aobj.maxHeight)
            {
                nheight = aobj.maxHeight;
                $(this).css("overflow-Y",'scroll');    
            }    
            else
            {
                nheight = $(this).attr("scrollHeight");
                $(this).css("overflow-Y",'hidden');    
            }
            $(this).height(nheight);
       }
    }
)
 
     
    