mercredi 11 février 2015

jquery loop on textarea text reverse order?


i have textarea with text that is sperated with line break i want to loop this list in reverse order? so if i have text that loop like this



1,1,1,1,1,1,1,1
1,1,1,1,1,1,1,2
1,1,1,1,1,1,1,3
1,1,1,1,1,1,1,4
1,1,1,1,1,1,1,5


it will read from 1,1,1,1,1,1,1,5 ... to .... 1,1,1,1,1,1,1,1 i know i can loop the text area like this :



$.each($('textarea[name=source]').val().split('\n'), function(e){
alert(this);
});


how can i convert it so it read the text in reverse order





Aucun commentaire:

Enregistrer un commentaire