JSFiddle - React, Tailwind, and code Playground

by antisanity

HTML

<ul>
    <li><b>Cats</b>
        <table>
            <thead>
                <tr>
                    <th>Name</th>
                    <th>Breed</th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td>Whiskers</td>
                    <td>Tabby</td>
                </tr>                
            </tbody>
        </table> 
    </li>
    <li><i>Dogs</i>
        <table>
            <thead>
                <tr>
                    <th>Name</th>
                    <th>Breed</th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td>Dakota</td>
                    <td>German Shepherd</td>
                </tr>                
            </tbody>
        </table>
    </li>
</ul>
<input type="button" value="switch" id="cmdSwitch" />

JavaScript

document.getElementById("cmdSwitch").addEventListener("click", function(e){    
    var list = document.querySelector("ul");
    list.appendChild(list.firstElementChild);
});