How to remove class from an element after delay using jQuery


Free jQuery snippet to remove class from an element after delay of a few seconds. This snippet uses setTimeout function to delay the execution of the script. To remove class we simply use removeClass jQuery function.

Source Code:

<script>
	$(document).ready(function () {
		$("div").addClass("red");

		setTimeout(function() {
			$("div").removeClass("red");
		}, 3000);
	});
</script>

Free - Download it right now!


Tested

Include all files

Demo Download
Unlock Your Free Download for Just $2

Reviews and Comments