Quantcast
Channel: How to auto-size a textarea in height? - Stack Overflow
Browsing latest articles
Browse All 4 View Live

Answer by user16590017 for How to auto-size a textarea in height?

Try this and enjoy:var textarea = document.getElementById("YourTextArea");var limit = 50; //height limittextarea.oninput = function() { textarea.style.height = ""; textarea.style.height =...

View Article


Answer by DanMan for How to auto-size a textarea in height?

This function will set the height of the element (textarea, in your case) to the browser's default height. If that causes a scrollbar to appear, the height will be switched to the actually needed...

View Article

How to auto-size a textarea in height?

I set the width of a textarea to 100%, but now I need to know how many characters can fit in one row.I'm trying to write a javascript function to auto-grow/shrink a textarea. I'm trying to keep from...

View Article

Answer by Rizumu Ayaka for How to auto-size a textarea in height?

It is recommended to add a step to calculate the thickness, which can correctly handle the border width on the input box and avoid unexpected scrolling.textarea.oninput = function () {...

View Article
Browsing latest articles
Browse All 4 View Live