Вообще без id
<textarea oninput="limitText(this,this.nextElementSibling,100);"></textarea>
<input readonly type="text" name="count" size="3" value="100"> осталось символов
<textarea onkeydown="limitText(this,this.nextElementSibling,100);"></textarea>
<input readonly type="text" name="count" size="3" value="100"> осталось символов
<textarea onkeyup="limitText(this,this.nextElementSibling,100);"></textarea>
<input readonly type="text" name="count" size="3" value="100"> осталось символов
<textarea onkeypress="limitText(this,this.nextElementSibling,100);"></textarea>
<input readonly type="text" name="count" size="3" value="100"> осталось символов
<script>
function limitText(limitField, limitCount, limitNum) {
if (limitField.value.length > limitNum) {
limitField.value = limitField.value.substring(0, limitNum);
} else {
limitCount.value = limitNum - limitField.value.length;
}
}
</script>