In this section, you will learn how to count words written in text area.
In this section, you will learn how to count words written in text area.In this section, you will learn how to count words written in text area. For this, we have created a text area to allow the user to enter words of their choice. The javascript takes the value of the text area and using the regular expression, determine the number of words and finally display it in the textbox. This whole functioning is done through onkeyup event that will display the number of the words in the textbox as the user enter the words in the text area.
Here is the code:
<script
language="JavaScript"> |
Output
On specifying words in the text area, you will get the following output: