Quantcast
Channel: Active questions tagged html - Stack Overflow
Viewing all articles
Browse latest Browse all 74325

How can I calculate the maximum number of rows in a textarea with a set height?

$
0
0

I'm currently developing a sort of browser based word processor and am using a textarea to hold the contents. The textarea has a height set to 100% to fill a container div with padding and other elements in it. Is there a way I can calculate the number of rows that will fit in the textarea without overflowing so I can prevent additional lines from being created? I could of course just hide the overflow, but I don't want that excess text to get saved when I push the contents to a database.


Viewing all articles
Browse latest Browse all 74325


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>