$('#leave-reason-input').keyup(function() { var height = $(this).scrollTop(); var initHeight = 5; if(initHeight < height ) { $(this).css({'height':'8rem'}); } })