One of the functionality i like most with jQuery is the ability to add class or classes to HTML elements.

Using the addClass() method, you can add single or multiple classes to all target elements.

To add multiple classes, separate the classnames with a space.


	jQuery(function($) {
		$('#green').click(function() {
			$('p').addClass('green bold');

Try it yourself →