[removed] Convert textarea into an array

后端 未结 6 1730
萌比男神i
萌比男神i 2020-12-08 13:44

How would you go about breaking up a textarea value into an array, based on the end of line separation? Use of jQuery is cool by me...

6条回答
  •  南方客
    南方客 (楼主)
    2020-12-08 14:18

    This should work (tested in Firefox and Google Chrome):

    var arrayOfLines = $('#textAreaID').val().split('\n');
    

提交回复
热议问题