Adicionar classe na função JavaScript OnClick

document.addEventListener('click', function handleClick(event) {
  console.log('user clicked: ', event.target);

  event.target.classList.add('bg-yellow');
});
Graceful Goosander