Link to home
Create AccountLog in
Avatar of areyouready344
areyouready344Flag for United States of America

asked on

how to set a variable on a jquery filter?

how to set a variable on a jquery filter? This is not working.

var setHighLight = "last";

$("#ul_b li:(' + setHighLight +')").addClass('highlight');
Avatar of leakim971
leakim971
Flag of Guadeloupe image

$("#ul_b li:' + setHighLight).addClass('highlight');
ASKER CERTIFIED SOLUTION
Avatar of leakim971
leakim971
Flag of Guadeloupe image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of areyouready344

ASKER

thanks Leakim, its now working.
var third = 2;
$("#ul_b li:eq(" + third + ")").addClass('highlight');