6/12 Need Help


#1



https://www.codecademy.com/courses/web-beginner-en-JwhI1/1/2?curriculum_id=50a3fad8c7a770b5fd0007a1#


I know that the code is right, but when I try to proceed, I get an error message that says, "Unable to get property '1' of undefined or null reference", I have absolutely no idea what this means. Is this a problem with my code, or is this a glitch in the system of some sort?


$(document).ready(function(){

  $('div').hover(
    function(){
        $(this).addClass('active');
    },
    function(){
        $(this).removeClass('active');
    }
  );

});


#2

That's strange...try resetting your code. Maybe something in the html or css was modified accidental and is causing this error.


#3

I've got the same error Unable to get property '1' of undefined or null reference, how did you resolved?


#4

I'm sorry, it didn't work. Is there anything else you could recommend?


#5


#6

The space, I try much much times, after move some empty lines, it worked.


#7

I had the same issue.
I had removed some extra empty lines to organize it better and got the error, but when I restructured it the way codecademy had it, it worked.


#8

#10

I just tried all the ways you guys said, but it still didn't work. Why?
here's my code.

$(document).ready(function(){

  $('div').hover(
    function(){
        $(this).addClass('active');
    },
    function(){
        $(this).removeClass('active');
    }
  );

});

On the screen projector it works.
please tell me why


#11

by the way, why are all the 'h' s highlighted?:slight_smile:


#12

This was an issue before, if you hover over the div's for more than 2 seconds it clears the lesson.


#13

I'm also having this problem, it says that I didn't change my background color, well, it didn't ask to...


#14

Code looks good, my issue was when I clicked "save and submit" I wasn't doing EXACTLY what the page was telling me regarding the hover and curser placement. try looking towards the bottom and do exactly what it says.


#15

This is the solution. Hover over the div until the text at bottom says, "Please move your mouse out of the div."


#16

Thank you! You solved it!