SoFunction
Updated on 2025-02-28

js limits the input length of the form Chinese characters to two characters

This effect is integrated into a function, which accepts 3 parameters:
The first is the ID of the textarea or other text form;
The second one is the ID of the input content, which can be left blank;
The third one is the most input character, and one Chinese character has 2 characters.
This is just a basic effect, and students are welcome to optimize and improve.
To get the code, please check the demo's source file

[Ctrl+A Select all Note:Introducing external Js requires refreshing the page before execution]