[removed] detect textarea to be full

前端 未结 2 622
广开言路
广开言路 2020-12-21 16:47

I am trying detect when a textarea becomes full for creating pagination effect. Using the .length property will not work, however, because long words \'jump\' to new lines.

2条回答
  •  既然无缘
    2020-12-21 17:21

    In runtime, you may listen to the key-press event of the textarea, pass the textarea.val() value into a hidden

    , then get mypre's width or even height $("#mypre").width(). It's your decision how you'll work with the "simulated" width/height.

提交回复
热议问题