I am trying select some divs where the data attribute x10 equals the variable Xmodule. I have something wrong with the selector but I don't know what is wrong.
//find data element that matched Xmodule and display either on or off class
$('div[data-x10=Xmodule]').each(function(){
if (XStatus ==="2")
{element.removeClass('off').addClass('on');}
else
{element.removeClass('on').addClass('off');};
});
elementfrom ?$(this)instead ofelement?