var textarea = document.getElementById(textarea),  statusBar = document.getElementById(status-bar);    function updateStatusBar() {      var text = textarea.value,        chars = text.length,        words = text.split(/\b\S+\b/g).length - 1,        lines = text.split(\n).length;      statusBar.value = lines +  lines,  + words +  words,  + chars +  characters;    }
Calculate number of words and characters (/statistics) from an HTML Textarea
javascript;html;dom;statistics