Transversing & Replacing Classes
I wish to replace a class name for a child element (ul) of parent (li.filetabs) element. What I have done seems quite right but it's obviously not as the class is not being replace
Solution 1:
I'm not sure I get this at all, but try:
$('.filetabs').on('click', function() {
var aFileTabs = $('.filetabs'),
curTab = $(this),
prevCurTab = $('.cTabActive').parent();
$('.cTabActive').removeClass('cTabActive').addClass('cPrevTabActive');
$('ul', curTab).removeClass('cPrevTabActive').addClass ('cTabActive');
});
Post a Comment for "Transversing & Replacing Classes"