Still lost on News Reader


#1

Remember to add the else if statement. Make sure to use === to check if event.which is equal to 110

var main=function() {
$('.article').click(function(){
$('.article').removeClass('current');
$('.description').hide();
$(this).addClass('current');
$(this).childern('.description').show();
)};

$(document).keypress(function(event) {
if(event.which=== 111) {
else if(even.which=== 110)
$('.current').childern('.description').toggle();
}
});


#2

Hi Chris,

You need to close your if statement with a closing curly brace (}) before you can start your else if statement. Also, you mistyped event :wink:


#3

still having trouble this is my current thing please be Specific

var main=function() {
$('.article').click(function(){
$('.article').removeClass('current');
$('.description').hide();
$(this).addClass('current');
$(this).childern('.description').show();
)};

$(document).keypress(function(event) ({)
if(event.which===111) {
else if(even.which===110)
$('.current').childern('.description').toggle();
}
});
$(document).ready(main);

Remember to add the else if statement. Make sure to use === to check if event.which is equal to 110


#4

@methodblaster43160

You need to close your if statement with a closing curly brace (}) before you can start your else if statement. Also, you mistyped event

Follow those instructions. If they don't make sense to you, you should probably take the JavaScript course and then come back to this.


#5

A post was split to a new topic: I am facing difficulties to go ahead coding