jquery limit text by length

前端 未结 6 1434
走了就别回头了
走了就别回头了 2020-12-16 18:46

Can i hide text in a DIV after a number of characters with jQuery?

So far I think it would go something like this - jQuery would cycle through the text until it gets

6条回答
  •  无人及你
    2020-12-16 19:08

    If you put a onkeydown event handler on the body tag you can then count the length in the div of interest, and then you can hide it when done, and remove your event handler.

提交回复
热议问题