I have a text area, and I want to display the number of lines in real time. So I came up with these code
var count = document.getElementById('ccs').value.split("\n").length;
document.getElementById("count").innerHTML = count;
<p id="count"></p>
<textarea class="" id="ccs" rows="15" wrap="off" style="resize: none; overflow: auto; width:100%" placeholder="Text"></textarea>
How do I loop my script?