Don't know what I am doing wrong, I keep getting an error


#1

Hi,

I am at the very beginning of jQuery and my code is not working no matter how I write it. The instructions say the following:

"place fadeTo() inside mouseenter(). make it so your 'div' fades to 1 (100%) opacity when your mouse enters the 'div'. Make the animation speed 'fast'.

` $(document).ready();{
$('div').mouseenter(function();
$('div').fadeTo('fast', 1);
});
});

I get this error message: "Oops, try again. It looks like you didn't set your div's opacity to 1. Check the example to in the instructions if you need help!"

It is set to 1 though...so I don't know what I am doing wrong. Should I put the .fadeTo inside the function? Should I replace the function with .fadeTo? Am I missing a bracket or semicolon?

Thanks.


#2

@faar23

Just a quick observation you have two }); but only one opening {

where do you think the other should be?

This should work, let me know if not

$(document).ready(function(){
 $('div').mouseenter(function(){
$('div').fadeTo('fast', 1);
});
});

What is the correct syntax in jQuery?
#3

Yes that works, thank you so much!