使用Javascript:textarea的转换到一个数组 [英] Javascript: Convert textarea into an array
本文介绍了使用Javascript:textarea的转换到一个数组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您会如何去打破一个textarea值到一个数组,基于隔离线结束了吗? jQuery的使用是由酷我...
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...
推荐答案
这应该工作(在Firefox和谷歌Chrome测试):
This should work (tested in Firefox and Google Chrome):
var arrayOfLines = $('#textAreaID').val().split('\n');
这篇关于使用Javascript:textarea的转换到一个数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文