JSFiddle - React, Tailwind, and code Playground

HTML

<ul id="colors">
    <li id="yellow">yello</li>
    <li id="orange">orange</li>
    <li id="red">red</li>
</ul>

JavaScript

var colors = document.getElementById('colors');

colors.addEventListener('click', function(e) {
    var el = e.target,
       color = el.id;
    
    document.documentElement.style.backgroundColor = color;
});