any if statement I put inside this function refuses to work.
The statement is true for some elements with this class and false for some, however all ignore it
(This is very stripped functionality just to locate the problem…)
$(".bought").each(function(index) {
Height = $(this).css("height")
if (Height > 19) {
alert(Height);
}
});
this does work:
$(".bought").each(function(index) {
Height = $(this).css("height")
alert(Height);
});
$(this).css("height")returns string…you need to parse this in int before applying comparison..