The o shortcut


#1

Hello,
I can't figure out what am I doing wrong and it wont let me continue. Could you please help me?

This is what I wrote:
var main = function() {
$(.'article').click(function() {
$(.'article').removeClass('current');
$(.'description').hide();

$(this).addClass('current');
$(this).children('.description').show();

});

$(document).keypress(function(event) {
if(event.which === 111) {
$('.current').children('.description').toggle();
}
});

$(document).ready(main);

Thank you in advance!! :slightly_smiling:


#2

Hi Amalie,

When selecting something by one of it's classes, you need to have the dot (.) inside the quotes as well as the parenthesis. For example,

// this
$('.description')
// not this
$(.'description')

After you do that, you need to close your main function with a closing curly brace (}) placed on the next to last line :slightly_smiling:


#3

A post was split to a new topic: Stuck on "The O Shortcut"