How to read line by line of a text area HTML tag

后端 未结 5 1079
借酒劲吻你
借酒劲吻你 2020-11-29 21:10

I have a text area where each line contains Integer value like follows

      1234
      4321
     123445

I want to check if the user has re

5条回答
  •  一生所求
    2020-11-29 22:02

    A simple regex should be efficent to check your textarea:

    /\s*\d+\s*\n/g.test(text) ? "OK" : "KO"
    

提交回复
热议问题