JSFiddle - React, Tailwind, and code Playground

by swfour

HTML

<ul>
    <li>
        <p>Operating System:
            <select class="selectmenu" id="whatever" name="OS" onchange="markDirty();" required='required'></select>
        </p>
    </li>
    <li class="osother">Please Specify:
        <label id="oslabel">
            <input name="Other OS" type="text" placeholder="Other OS" size="50" />
        </label>
    </li>
    <li class="osother">Version:
        <label id="version">
            <input name="OSV" type="text" placeholder="OS Version" size="50" />
        </label>
    </li>
</ul>

CSS

.osother {
    display:none;
}

JavaScript

$(document).ready(function () {
    $("select").change(function () {
        $("select option:selected").each(function () {
            if ($(this).attr("value") == "otheros") {
                $(".osother").show();
            }
        });
    }).change();
});