The 'o' shortcut


#1



I don´t understand, what is wrong?

var main = function(){
    ('.article').click(fuction(){
        $('.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);


#2

@daniel2213perez,

You might want to add a "$"
like

$('.article').click(fuction(){

#3

var main = function() {
$('.article').click(function() {
$('.article').removeClass('current');
$('.description').hide();

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

}
};

$(document).ready(main);
what about this


#4

@anah13cheynec
In your article =click= Eventhandler
the only functionality of the toggle() will be to show() the =description= of the =clicked= article
as you first use a hide() on ALL =descriptions=