To count the text entered by the user in the text box, It is shown below. After research, a good method can be found, which can perfectly solve the problem after the text is deleted, the word count change problem recently encountered in a project. We need to count the text entered by users in the text box and display it below, because we are working on an SMS sending platform, if your text message service in our country contains more than 70 characters, the text message will be sent to you in two ways. Therefore, we need to show the user the number of words he entered. So that the user can know how many pieces of information will be provided.
I put a code on the Internet and started using it. It was okay, but I found the problem after using it for a while. That is, after you delete the text, there is a problem with the number of words in the text above. Later, I studied it and found the problem. OnKeyDown = "showLen (this)" onKeyUp = "showLen (this) used only one of the methods each time, and none of them were used, the two methods are used to count when you press the keyboard and release the keyboard. Well, I will put the program up.
New Document
</Pre>