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...
+1
A:
This should work (tested in Firefox and Google Chrome):
var arrayOfLines = $('#textAreaID').val().split('\n');
Daniel Vassallo
2010-02-19 21:14:59
It should be `$('#textArea').val().split('\n')`, the jQuery object doesn't have a `value` property.
CMS
2010-02-19 21:21:41
@CMS - or even $('#textArea')[0].value.split('\n') :)
Russ Cam
2010-02-19 21:25:18
@CMS: Oops. Thanks for noting.
Daniel Vassallo
2010-02-19 21:44:30
$('#textArea').val().split('\n') did the trick
Matrym
2010-02-19 21:46:03
+1
A:
var txtarea = document.getelementbyId('textarea');
var stringarray = txtarea.value.split('\n');
Eric
2010-02-19 21:22:01