jQuery add class

01.Jul.2010

To add class to HTML element using jQuery, you should be using jQuery function addClass(). By using a selector to match elements on HTML and calling function .addClass(‘className’); you can add class to the specific element. See example:

1
jQuery('#element_id').addClass('className');