9/16 - Buttons not clickable


#1

I have completed the lesson 9 and it says its correct, but for some reason I’m unable to click on the Recent Projects “button.” All it does is select the text.

https://www.codecademy.com/courses/learn-javascript/lessons/javascript-dom/exercises/show?action=lesson_resume



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

$(document).ready(main);



#2

Update: I have tried it on both Chrome and Safari and it hasn’t worked on either.


#3

Hi @javaninja55926,

Your code looks fine. Tested it with chrome browser.

I’m not sure what issue you encountered, just to be sure, for the first time when you load the website, the outlook will be something like below:

HTML & CSS

Recent Projects

JavaScript

Recent Projects

jQuery

Recent Projects

When you clicked on the Recent Projects div, it will turn out this way:

HTML & CSS

Recent Projects

Broadway
MOVE

JavaScript

Recent Projects

Password Validator
Whale Talk

jQuery

Recent Projects

Coming soon...


If you’re getting the result above, then that is what expected. The code:

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

Will show the projects class once you clicked the button (.projects-button div), if you click several times after that, nothing will happen because all the .projects class are shown and there is no further code do to anything else.

But if you’re not getting the result I stated above when you click the div the first time, then I have no other idea, probably should send a bug report to the team. There’s a link to file a report inside the exercise.


Hope it helps. :slight_smile:


#4

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