У меня есть календарь, это настройка для отметки текущего дня
if (i == day) //if is current day { $(this.parentNode).addClass('current'); // problem, doesn't work $("tr:last").append(td tag with class current); // works fine }
Альтернативно, немного лучшее решение:
$(this).closest("td").addClass("current");
http://api.jquery.com/closest/
$(this).parents("tr").addClass("current");
http://api.jquery.com/parents/