jQuery Functions and Selectors - Variables



No idea what I am doing wrong here.

To pass this I thought I would use pseudo-class selectors but nope still giving me this error.
I have also tried creating a new ID and assigning $target to that ID but still not working.

Oops, try again. Did you target the 4th li child of the ordered list? Check the Hint if you need help.

Not sure why this simple exercise is messing me up so much.

// Write your jQuery code on line 3!
$(document).ready(function() {

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

I have also tried multiple browsers.


$target is not declared within document ready, so the code never executes


You are so right. And how did I not even read the comment. That makes complete sense just like a normal JS function. Sometimes man I question myself. Ty tho @stetim94 you the best.


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