views:

31

answers:

1

Hi All, As the title goes I am trying something like

 $("ul li:nth-child(' + xx + ') a").text() //this is coming as blank.

what is the correct format?

A: 

You need this format:

var xx = 4;
$("ul li:nth-child(" + xx + ") a").text()

You want to actually append to the string here to get what you want so it results in this:

$("ul li:nth-child(4) a").text()
Nick Craver
my bad.Thax for the help.
Wondering