Inside an $.each()
loop, there is one specific case that I don't understand why is failing.
When I do an if statement that says something like this (my specific example, only without the real attribute names)
if(($(this).attr("some-attribute")))
it always returns false, whether or not the attribute exists.
But if i first get the id of this element and then check for the attribute without the "this" keyword, it works okay.
var id = $(this).attr("id");
if(($("#"+id).attr("some-attribute")))
This works fine and it does return the correct value.