Code Library
Home Submit Free Hosting Link To Us Contacts

JavaScript Auto textarea resize

JavaScript Auto textarea resize JavaScript JavaScript Auto textarea resize Download (.zip)



<script type="text/javascript">
function fitToText()
{
 if (this.scrollHeight>this.clientHeight)
 {
  this.style.height=(this.scrollHeight+20)+"px";
 }
 else
 {
  this.style.height="10px";
  this.style.height=(this.scrollHeight+20)+"px";
 }
}
</script>
<textarea id="bid" style="overflow-y: hidden; width: 300px; height: 50px"
 oninput="fitToText.call(this)"
 onpropertychange="if (event.propertyName.toLowerCase()=='value') fitToText.call(this)">
</textarea>




  • JavaScriptAuto textarea resize Textarea characters left Textarea Text Insert


Tatet