<html>
<script src= "../../ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
$("button").click(function(){
$("h1, h2, p").toggleClass("blue");
});
});
</script>
<style>
.blue {color: blue;}
</style>
<body>
<h1>Heading 1</h1>
<p>This is a paragraph.</p>
<button>Toggle class</button>
</body>
<!-- Mirrored from www.w3schools.com/whatis/tryit.asp?filename=trywhatis_jquery_dom_class by HTTrack Website Copier/3.x [XR&CO'2014], Mon, 27 Jan 2020 02:56:10 GMT -->
</html>