Why does Javascript only count carriage returns as one character when it is two?

后端 未结 1 597
暗喜
暗喜 2020-12-28 19:19

This is an offshoot of this question: Chrome counts characters wrong in textarea with maxlength attribute


In that question it was found that Javascript counts

1条回答
  •  心在旅途
    2020-12-28 19:47

    For reasons unknown, jQuery always converts all newlines in the value of a