Click–Exercise 8


#1

I am stuck on learn javascript lesson 8. Could someone point to me what went wrong?

var skillset= document.getElementsByClassName('skillset');
alert(skillset);
var main = function() {
var $skillset = $('.skillset');
  alert($skillset);
  $('.skillset').hide();
  $('.skillset').fadeIn(1000);
};
$('.projects').hide(skillset);
$(document).ready(main);


https://www.codecademy.com/courses/learn-javascript/lessons/javascript-dom/exercises/click

Did you write a selector for the elements with a class of projects?
Did you hide the elements with a class of projects?


#2

Ths code worked for me

function main() {
$('.skillset').hide();
$('.skillset').fadeIn(1000);

$('.projects').hide();

$('.projects-button').on('click', function() {

});

}

$(document).ready(main);


#3

This code is what they want:

function main() {
$('.skillset').hide();
$('.skillset').fadeIn(1000);

$('.projects').hide();

$('.projects-button').on('click', function() {
$('.projects').toggle();
$('.projects-button').toggleClass('active');
});
}

$(document).ready(main);


#4

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