Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7977129
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T09:06:18+00:00 2026-06-04T09:06:18+00:00

<body> <script type=text/javascript>$(function(){ $(textarea).live(keyup keydown,function(){var h=$(this); h.height(h[0].scrollHeight); });}); </script> <textarea style=resize:none;width:760px;height:60px; overflow:hidden; ></textarea> </body>

  • 0
<body>
<script type="text/javascript">$(function(){
$("textarea").live("keyup keydown",function(){var h=$(this);
h.height(h[0].scrollHeight);
});});

</script>
<textarea style="resize:none;width:760px;height:60px; overflow:hidden;" ></textarea>
</body>

When textarea get overflowed it get scrollbar and scrollheight which gets applied to its height but not working for decreasing textarea height as on decreasing its value length it doesnot get scrollbar

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T09:06:19+00:00Added an answer on June 4, 2026 at 9:06 am

    The minimum scrollHeight of a textarea is always going to be the height. To get an accurate scrollHeight, set the height to 1 first.

    h.height(1).height(h[0].scrollHeight);
    

    http://jsfiddle.net/aarongloege/t2vAr/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

<script type=text/javascript> function removeLink() { document.getElementById(tab2).deleteRow(i); } </script> </head> <body> <form action=forth.php method=post> <table
I have fetched json through <script> function getjs() { var script =document.createElement(script); script.setAttribute(type,text/javascript); script.setAttribute(src,http://localhost:8080/vigs/f4json?user=3&callback=gr);
I would like to add this code: <script type=text/javascript src=http://www.formstack.com/forms/js.php?1134414-uqmj2UXxEw-v2> </script> <noscript> <a href=http://www.formstack.com/forms/CampusEnterprises-chopped_greens_order_form__copy
<html> <head> <title>Untitled 1</title> <script language=javascript type=text/javascript src=../js/jquery.js></script> <script type=text/javascript language=javascript> $(document).ready(function() { $(#usermsg).keypress(function(e)
$('body').append('<style type=text/css> body {background:red;} </style>'); This doesn't make the background red. Is there away
Here is my jQuery code: <script type=text/javascript> //<!-- $(document).ready(function() { $('input[type=submit]').click(function() { $.ajax({ type:
I made this Greasemonkey script: var maxpi = 250; var p1 = /html/body/div/div[2]/div/div[2]/table[2]/tbody/tr[1]/td[11]; var
so here is the script: <script> var div = $(#gridline1); $(document.body).mousemove(function(e){ if(e.pageX<630){div.animate({right:'+=1'},1);} else {div.animate({left:'+=2'},1);}
$.post('includes/script.php', $(this).serialize(), function(data) { $('body').append(data); }); alert ($('#new').length) php script is <php echo <div
I'm new to JavaScript. Here's my code: <script> function text_input_type(type) { if(type=='list'){ document.getElementById("note_input").innerHTML="<input type=\"text\"

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.