<title>jQuery toggleClass() Method Either Add or Remove Class Name With Toggle Switch</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
$(document).ready(function(){
$('.addtoggleswitchbtn').click(function(){
$("p").toggleClass("toggleswitchpara", true);
$('.removetoggleswitchbtn').click(function(){
$("p").toggleClass("toggleswitchpara", false);
<h2>jQuery toggleClass() Method Either Add or Remove Class Name With Toggle Switch</h2>
<button type="button" class="addtoggleswitchbtn">Click to Add Class</button> <button type="button" class="removetoggleswitchbtn">Click to Remove Class and Toggle</button><br><br>
<p>This is my paragraph</p>