JQuery Lesson Issue


#1


https://www.codecademy.com/courses/web-beginner-en-bay3D/0/3?curriculum_id=50a3fad8


When I click Save & Submit Code I get an error message saying "It looks like you hid BOTH divs - you should only hide the div with ID #green." When the code runs, the div which is green disappears, and the one which is red does not. The code I have is correct, but the system is saying it is incorrect and will not let proceed to the next part of the course.


HTML CODE:

<body>
    <div></div>
    <div id="green"></div>
</body>

JQUERY CODE:

$(document).ready(function() {
    $("#green").fadeOut(1000);
});


#2

Are you showing us all the HTML? It won't work with just that above.


#3

No that is not all of the HTML code. It's all of the HTML that comes already written in that exercise. I just copy and pasted the relevant HTML code that the jquery function is calling.


#4

I only ask because the JS works and passes for me, given the complete HTML.


#5

So I just downloaded Google Chrome and tried doing it in that and it worked fine. I was originally using Safari and it would not pass for some reason. I'm not quite sure why, but I will just continue on with Chrome for the rest of the lesson. Thanks for giving it a go, as you informing me that code worked fine pretty much confirmed that something different was going on other than incorrect coding.


#6

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