html
Click
jquery
Inside .each loop line id 'item' object, not 'this'.
Click $('#btn').click(function(){ var arrayOfLines = $('#gps').val().split('\n'); $.each(arrayOfLines, function(index, item) { console.log('here is line:', item); }); });