<html lang="en">
<head>
<title>jQuery addClass() Method</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script>
$(document).ready(function(){
$("#btn-add").click(function(){
$("#para-add").addClass("myaddclass");
});
});
</script>
<style>
.myaddclass{
background:#ccc;
padding:10px;
}
</style>
</head>
<body>
<h2>jQuery addClass() Method</h2>
<p>When you click the below button, it adds the class <code>'myaddclass'</code> to the below p element.</p>
<button id="btn-add">Click to Add Class</button>
<p id="para-add">This is the jQuery Tutorial of add CSS class.</p>
</body>
</html>