jQuery 12: $(this) selector not working


#1

Here's the code from the exercise:

function main() {
$('.skillset').hide();
$('.skillset').fadeIn(1000);
$('.projects').hide();
$('.projects-button').on('click', function(){
$('.projects').toggle();
$(this).toggleClass('active');
});
}

$(document).ready(main);

When I added the $(this) selector it did not work. When I click on the button all of the recent projects show, just as before. What am I doing wrong here?


#2

never mind, I have the answer.
sorry about that


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.