jQuery Class Selectors

 
The .class selector selects all elements with the specific class.
 
The class refers to the class attribute of an HTML element.
 
The class attribute is used to set a particular style for several HTML elements.
 
Note: Do not start a class attribute with a number. It may cause problems in some browsers.

<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js">
</script>
<script>
$(document).ready(function(){
  $(".firstClass").css("background-color","#CCC")
  $(".firstClass").html("Class Selectors");
});
</script>
</head>
<body>
	<p class="firstClass"></p>
</body>
</html>