<div id="conteudo">
  <h1>Henrique Marques Fernandes</h1>
  <button id="botao">Clique aqui</button>
</div>
var fundoPreto = false;
document.addEventListener('click', function (event) {
  event.preventDefault();
	if (!event.target.matches('#botao')) return;
  if (fundoPreto) {
    document.getElementById("conteudo").style.background = "#FFF";
    document.getElementById("conteudo").style.color = "#000";
    fundoPreto = false;
    return; 
  }
  document.getElementById("conteudo").style.background = "#000";
  document.getElementById("conteudo").style.color = "#FFF";
  fundoPreto = true;
}, false);

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.