$('ul.menu li a').each(function (){ all_text = $(this).text(); array_words = all_text.split(' ') for(word in array_words){ if(word % 2 != 0) { alert("<em>" + array_words[word] + "</em>") } } });