Link to home
Start Free TrialLog 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
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of areyouready344

ASKER

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