可能重复:
如何获取 <textarea > 中的行数?
我有一个textarea
,我7 lines
只2 new line character
用下面这样写,想象下面的代码框是一个textarea
,并且只按下了两次回车键。
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.
textarea line count
如果现在是多写几行之后n
。如何计算 的值n
?
回答问题前请先说清楚。我不想数new line characters
像这样的文字中有多少。如何获取文本区域中的行数?
我想计算行数,就像Microsoft Word从段落中计算它一样。
请不要 jQuery...