areyouready344
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' );
var setHighLight = "last";
$("#ul_b li:(' + setHighLight +')").addClass('highlight'
$("#ul_b li:' + setHighLight).addClass('hi ghlight');
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
thanks Leakim, its now working.
var third = 2;
$("#ul_b li:eq(" + third + ")").addClass('highlight') ;
$("#ul_b li:eq(" + third + ")").addClass('highlight')