"It looks like you didn't set your div's opacity to 1" error on 2/3


#1

Hi I'm getting the same error.
Here's my code:

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

And here's the link to the page:
https://www.codecademy.com/en/courses/web-beginner-en-bay3D/2/3?curriculum_id=50a3fad8c7a770b5fd0007a1

Thanks


Why does it tell me I'm not setting the div's opacity to 1?
#2

@spookywalrus Your code passes for me. Does refreshing the page let you pass?


#3

No, refreshing does not let me pass. Nor does the test page show the results


#4

@spookywalrus Can I see your HTML code, please?

See how to make it visible here:


#5

Sure. Here's the html. I've cut and pasted straight from the tutorial.

<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>


#6

@spookywalrus Here's your problem:

<script> type="text/javascript" src="script.js"</script>

type="..." and src="..." are attributes which go on your opening <script> tag, so that line needs to be changed to look like this instead:

<script type="text/javascript" src="script.js"></script>

:slight_smile:


#7

That worked!

Thank you so much.


#8

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.