DomTokenList.add is used to add more tokens to a list such as adding a class to an element. It can help stylize webpages with the use of css classes.

HTML

<body>
    <div>
      <h1>
        Nothing
      </h1>
      <br>
      <button onclick="change()">
        change
      </button>
    </div>
  </body>

CSS

body {
  display: flex;
  align-items: center;
  justify-content: center;
}

.something {
  background-color: #2F004F;
  color: white;
  font-style: italic;
}

JS

function change() {
document.body.classList.add('something');
}