Below code snippet helps you to find the number of lines in the input textarea using Jquery & native RegEx functionality.

var textInput = $(”#textareaId”).val();
var lines = textInput .split(/\r|\r\n|\n/);
alert(lines.length);