JSFiddle - React, Tailwind, and code Playground

by Derek Leung

HTML

<table>
    <tr>
        <td>
            <select onchange="wow(this.value)">
                <option value="a">a</option>
                <option value="b">b</option>
            </select>
        </td>
        <td id="x" class="show">x</td>
    </tr>
</table>

CSS

.show {
    display:inline-block;
}
.hide {
    display:none;
}

JavaScript

function wow(value) {
    var index = {
        a: "show",
        b: "hide"
    };
   document.getElementById("x").setAttribute("class", index[value]);}