//This works! but I was trying to avoid the extra class
$("a.active").parent().addClass("active");
$('li.active ul').clone().appendTo('.leftnav').removeClass();
// this does not work
$("a.active").parent(function () {
$('this ul').clone().appendTo('.leftnav').removeClass();
})
// does not work either
var activeLink = $("a.active").parent();
$(activeLink('ul')).clone().appendTo('.leftnav').removeClass();
そのネスト ul を探して、「これ」に追加できますか?
そうでない場合
変数に入れるとどうなる?