Exercise 11. Get Yourself In... Error Message


#1

Error Message: Oops, try again. Please follow the instructions on the Full Preview page to test your code.

I've tested in Full Preview and resubmitted, but I still get the error message. Here's the code:

<html>
	<head>
		<title>Button Magic</title>
        <link rel='stylesheet' type='text/css' href='stylesheet.css'/>
        <script type='text/javascript' src='script.js'></script>
	</head>
	<body>
     <div><br/><strong>Click Me!</strong></div>   
	</body>
</html>

div {
    height: 60px;
    width: 100px;
    border-radius: 5px;
    background-color: #69D2E7;
    text-align: center;
    color: #FFFFFF;
    font-family: Verdana, Arial, Sans-Serif;
    opacity: 0.5;
}

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

#2

Your jquery code is missing its main function that's why it doesn't work when you test and it wouldn't let you pass.

after .ready( you add function and all of your jQuery code runs in the function.

Like so:

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

#3

I don't follow. It looks like the line is there at the top. Still doesn't work.


#4

I'm talking about this line^ see function you didn't have that

paste in your updated code


#5

Thanks for getting back to me. Here's the code I have:

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

The function line is there, right? I even copied and pasted directly so I'm not sure where the error is. Appreciate the help, btw.


#6

What error are you getting ?

When you are testing it is it working ?
When you hover over it leave your mouse on click me for a few seconds before removing.


#7

The error message is:

Oops, try again. Please follow the instructions on the Full Preview page to test your code.

I've tried everything. I go into full screen then submit. I hover and click to submit. The error message still pops up!


#8

Please paste in your updated code


#9

Thanks! it works now


#10