In the learn jQuery section on variables


#1

Hi, so I am having trouble with the variable section in the learn jQuery area.

I need to target the 4th child of ol. what I have tried is

$(document).ready(function() {

var $target = li:nth-child(3); //also have tried li:nth-child(4)

$target.fadeOut('fast');
});

and

$(document).ready(function() {
var a12 = document.getElementsByTagName('ol')

var $target = a12.childNodes[3]

$target.fadeOut('fast');
});

none of this is working, and I am confused as to why not. Any help is appriciated

`


#2

Should be the result of a jQuery selector:

var $target = $('ol li:last');

#3

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