<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>JavaScript</title>
  <style>
    .supercolor {
      background: #000000;
    }
  </style>
  <script>
    function changecolor() {
      const element = document.getElementById("subtitle");
      element.classList.toggle("supercolor");
    }
  </script>
</head>
<body>
  <section>
    <h1>Website</h1>
    <p id="subtitle" class="supercolor" onclick="changecolor()">The best website ever!</p>
  </section>
</body>
</html>