I have a variable:
var MAX_OFFERS_TO_SHOW = 3;
And I want to use this variable as index for the jquery :lt() selector
$("div.notspecialoffer:lt()").slideDown();
How will I concatenate it?
I have a variable:
var MAX_OFFERS_TO_SHOW = 3;
And I want to use this variable as index for the jquery :lt() selector
$("div.notspecialoffer:lt()").slideDown();
How will I concatenate it?
Like this:
$("div.notspecialoffer:lt("+ MAX_OFFERS_TO_SHOW+")").slideDown();
Use +(Concat) operator as shown below:-
$("div.notspecialoffer:lt("+ MAX_OFFERS_TO_SHOW +")").slideDown();