Possible Duplicate:
How to get number of rows in <textarea >?
I have a textarea
and I write 7 lines
in it with only 2 new line character
like below, just imagine the following code box is a textarea
and only twice the enter key is pressed.
A text box, text field or text entry box is a kind of widget used when building
a graphical user interface (GUI). A text box purpose is to allow the user to
input text information to be used by the program.
User-interface guidelines recommend a single-line text box when only one line of
input is required, and a multi-line text box only if more than one line of input
may be required.
Non-editable text boxes can serve the purpose of simply displaying text.
After writing some more lines if now the textarea line count
is n
. How can I calculate the value of n
?
Please be clear before you answer the question. I don't want to count how many new line characters
are there in my text like this one. How to get the number of lines in a textarea?
I want to count the number of lines as like as Microsoft Word count it from a passage.
no jQuery please...
scrollHeight
... but theempty textarea
comes with12 rows
... though if I write 7 lines, it will return me 12... – Dorey