How can I create a word counter for a textarea with specific width and height, ensuring that the maximum number of words typed in the textarea does not exceed 100?
HTML
<div class="input-box">
<textarea name='textArea' id='textAreaId'></textarea>
<div class="word-counter">0/100</div>
</div>
CSS
.input-box {
width:500px;
border: 1px solid red;
position:relative;
display:table;
}
textarea {
width:500px;
height:80px;
padding-bottom: 20px;
}
.word-counter {
position:absolute;
bottom: 0;
right:0;
}