Skip to main content

Add CSS Class to an Element Using jQuery

Submitted by admin on Thu, 12/16/2021 - 18:37

In this jQuery tutorial we will learn how to add new css class to any element (div / span / paragraph etc.) using jQuery.

Using jQuery addClass() method, we can add new CSS class to any element.



To add more than one class, use below syntax.

$('element').addClass('class-one class-two');


In below example, we will add a class named newclass to header region.


Tutorial Category