3. Show a description


#1


Hi and thanks for looking at my question. I am stuck at exercise 3 for a reason i don't get. i checked the code multiple times and also copyed it from an other question but it still doesn't work. I understand the lesson i think but i really don't see my mistake in the code.
Please help me find de bug.
Thanks

https://www.codecademy.com/courses/web-beginner-en-4hxyb/0/3?content_from=make-an-interactive-website%3Ajquery-events#


I am getting this error message all the time:

Oops, try again.
It looks like the current article's description didn't show when
clicked. Remember to add code for $(this).children(); inside the event
handler. Look back at the instructions for the code.

And that's my exact code:

var main = function() {
  $(document).ready(main)
  $('.article').click(function() {
    $(this).children('.description').show();
  });
};


#2

HI this line

$(document).ready(main)

should be outside the main function

var main = function(){
   ...
};

$(document).ready(main)

#3

Thanks this solved the problem!


#4

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