JSFiddle - React, Tailwind, and code Playground

by rdenver6

HTML

<ul id="myList"><li>Coffee</li><li>Tea</li><li>Milk</li></ul>

<p>Click the button to remove the first item from the list.</p>

<button onclick="myFunction()">Try it</button>

JavaScript

function myFunction() {
    var list = document.getElementById("myList");
    list.removeChild(list.childNodes[0]);
}