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:
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:
One Response to this post
Leave a comment
Nice snippet, Just what I wanted

Peter Fisher recently posted..NHSNumberValidator is being used by the University of Nottingham