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);

Related posts:

  1. How to get the values of the selected checkboxes into an Array using Jquery
  2. How to create a for loop in jquery
  3. Live JavaScript Regular Expression Tester -HiFi Regex Tester
  4. How to parse XML data using Jquery