I'm trying to set a variable to 0 if an item attribute is equal a specific string, else set the variable to 1, but I can't get it to work.
My code is like this in my javascript function:
var variable;
if ($(this).attr("attribute", "string"))
variable=0;
else
variable=1;
For some reason, the variable always get set to 0, even if the item attribute isn't equal the specific string.
What am I doing wrong??