Jquery, get an array of text()

var array = $('li').map(function(){
               return $.trim($(this).text());
            }).get();

http://api.jquery.com/map/

Demo Fiddle --> http://jsfiddle.net/EC4yq/

Leave a Comment