.each()


var productIds = $('label.'+ productId);
      productIds.each(function(){

      });

Inside of .each() I want to find out if the element collection of productIds also has a class of ‘checked’. How can I do that using jQuery’s hasClass()? Everything I try I get an error saying object.hasClass() is not a function.


if ($(this).is(".checked")) {
  ....
}

http://api.jquery.com/visual/

Thanks, I think this will work.