Past lessons


#1

working on creating an interactive website with keypress. Not woring properly. Can you help? #7 short o

var main = function(){
<div class="article">
    <div class="item">
    </div>
    <div class="description">
    $(description).keypress(function(hide))
        $('.article').click(function()}
    <div class="current">
    $(description).keypress(.addClass(){
    $('current').children('.description').toggle()
    }
     $(document).keypress(function(event){
        if(event.which === 111){
            $('.current').children('.description').toggle();
        }
    };

    </div>
</div>
}
$(document).ready(main);

#2

Hi Frances,

Your code is very messed up :confused:

As a start, which file are you writing your code in? If it's index.html, then you need to move all of your JavaScript code out of the HTML file and into the JS file - it's called app.js.

Your JavaScript code is the stuff that looks like this:

$(document).keypress(function(event){
// or this: 
if(event.which === 111){
// or this: 
}
// etc.

and HTML looks like this:

<div class="article">
<!-- or this: -->
</div>
<!-- etc. -->