Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS jQuery Basics (2014) Creating a Simple Lightbox Perform: Part 3

Gary Calhoun
Gary Calhoun
10,317 Points

The previous challenge didn't accept double quotes?

I am not sure but the previous challenge for some reason didn't accept double quotes for some reason just out the outside of the div element?

it didn't accept this

var $overlay = $("<div id="overlay"></div>");

but accepted this

var $overlay = $('<div id="overlay"></div>');

1 Answer

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,860 Points

Hey Gary, The reason it wasn't accepted was because it was on the same line and within a set of quotes. When you need to use quotes inside of quotes, the inner quotes need to be different than the outer (enclosing) quotes. If you use the same ones, your second opening quote will be read by the compiler as the closing quote to the first opening quote. Does that make sense?

So you need to use the two kinds. It doesn't matter which ones you use inside or outside.

Example: "This quote is 'not part of this quote' but on its own" or 'This quote is "not part of this quote" but on its own'

This way the compiler know which closing quote belongs with which opening quote.

Hope that makes sense and clears it up for you. Keep Coding! :)

Gary Calhoun
Gary Calhoun
10,317 Points

Oh wow didn't realize that thanks for clearing it up!