javascript - How to set the word limit on Sina Weibo web version
代言
代言 2017-07-05 10:44:46
0
3
982


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

代言
代言

reply all(3)
扔个三星炸死你

The above is how to write jquery, js can be written like this

document.getElementById('textarea id').value.length;

It has been processed, Chinese is counted as 1 characters, and other characters such as English or numbers are counted as 0.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.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!