I can't get passed exercise 3


#1



I have tried every possible method I know to get passed this exercise. These are the solutions I've come up with so far but none of them have worked.


$("target") = $("ol li: last-child");
$("target") = $("ol li: nth-child(4)");
//This next two were after I created a class and an ID
$("target") = $(".chumps");
$("target") = $("#chumps");


#2

This is meant to be a variable. You are trying to assign a jQuery object to another jQuery object (they have the same constructor).

$target = $('ol li:nth-child(4)')

Side note: The colon belongs to the pseudo class selector, not the common element.

li:            // wrong

:nth-child()   // right

Also note that the $ has no meaning in a variable name other than to signify that it references a jQuery object or collection. There are no special powers associated since it is for code readability purposes, only.


#3

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