function showLen(obj)
{
document.getElementById("bodyLen").value=obj.value.length;
}
<textarea name="body" cols="40" rows="4" οnkeydοwn="showLen(this)" οnkeyup="showLen(this)"></textarea>
字数<input type="text" id="bodyLen" size="4" style="border-width:0;background:transparent;"/>
<br/>