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) {
    switch (value) {
        case "a":
            document.getElementById("x").setAttribute("class", "show");
            break;
        case "b":
            document.getElementById("x").setAttribute("class", "hide");
            break;
    }
}