javascript - How to set the word limit on Sina Weibo web version
代言2017-07-05 10:44:46
0
3
907
Just like the title. To add, maybe you don’t understand what I mean, the number of letters and numbers here and the number of Chinese characters are different
Since the upper right corner shows how many words have been entered during onchange, it is obviously the value of js monitoring onchange that takes the length
The above is how to write
jquery
,js
can be written like thisIt has been processed, Chinese is counted as
1
characters, and other characters such as English or numbers are counted as0.5
Please refer to: http://blog.csdn.net/haison_f...
Since the upper right corner shows how many words have been entered during onchange, it is obviously the value of js monitoring onchange that takes the length
Just handle it if it exceeds the length
Get the value of the text box, and then determine the length of the value.