I’m having trouble with question 1 on part 6 of Introduction to jQuery. It says:
We have several thumbnail images with a class of ‘product-photo’, but they don’t appear in the site because their display property is set to none in style.css . Let’s start by using jQuery to target every ‘.product-photo’.
I wrote in the editor $(’.product-photo’) and when I go to run it, it gives me a red x and asks if I targeted ‘.product-photo’. I don’t understand why it is doing this. Please help me with this question.
But my question is, did I write the correct code for the first part because I’m pretty sure for targeting the product-photo class it needs to be $(’.product-photo). Why is it giving me the error message, did you target ‘.product-photo’?
If your code was as above, there is a missing quote. But if the quote was there, then the selector is correct.
$('.product-photo')
Is your code contained in a ready wrapper?
Note that the above is an incomplete statement but the SCT should be ignoring any error that is thrown and checking the selecto composition, only. The second step completes the statement:
What is the problem with this part of Introduction to jQuery? I entered in the correct code. Even after I refreshed the browser (I’m using Chrome), it doesn’t register what I did and when I click Run, it gives me the same error.