<html>
<head>
<script>
function counter(el)
{
var wrapper = document.createElement('DIV');
wrapper.innerHTML = el.value;
var len = (wrapper.textContent || wrapper.innerText).length;
document.getElementById('count').innerHTML = len + ' | ' + el.value.length;
document.getElementById('kb').innerHTML = (len/1024).toFixed(2);
}
</script>
</head>
<body>
Вы ввели: <span id='count'>0</span> символов. <span id='kb'>0</span>Kb
<form>
<textarea id="text" onkeypress="counter(this);" onkeyup="counter(this);" onchange="counter(this);"></textarea><br>
</form>
</body>
</html>