Finding number of lines in an html textarea

The number of lines in the textarea would be

textarea.value.match(/\n/g).length + 1

Leave a Comment