//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();
Can you add to the "this" by looking for its nest ul?
if not
what about placing it in a variable?
here is the solution I found:
$('ul.nav a.active').parent().children('ul').clone().appendTo('.leftnav').removeClass();