Is there a way to add a class and then remove it after 500 milliseconds using jQuery? I tried using delay() but it didn't work as expected. Here is a simple example where I am changing the background color:
jQuery
$('.box').click(function(){
$('.box').addClass("bg1").delay(500).removeClass("bg1");
});