// Find the current item in the first list, remember its text
var textToMatch = $('ul.list1 li.current').text();
// Loop through each li in the second list
$('ul.list2 li').each(function(index, domElement){
var curr = $(domElement);
// if the text matchs the first then add our class
if(textToMatch == curr.text()){
curr.addClass('NEWCLASS');
}
});
РЕДАКТИРОВАТЬ1: Это ответ на неправильный вопрос, с тех пор вопрос был уточнен, я оставлю это здесь, поскольку это все еще кажется хорошимчтобы достичь того же самого, опять же, не то, что вопрос после.
$('.list2 li:contains("' + // Find an li in list2 which contains
$('.list1 li.current').text() + '")') // the same text as the as the current li in list1
.addClass("NEWCLASS"); // and add our new class to it