This is a really strange case.
If I click an element, the class of div disappears immediately both PC and MAC. Using removeClass it was fine that I want.
However mobile devices(iPhone and Android) are something wrong. When I try to click an element the class does not remove on the screen. But the console print out that the class go away. So I click any area of blank this element show as it normal.
I don't know why this issue happen to mobile device? What can I do to make the screen show immediate reaction?
$(".div").on('click touch', function(){
var idx = $(this).index(".div");
if($(this).hasClass("yellow")){
$(this).removeClass("yellow");
}
}