JSFiddle - React, Tailwind, and code Playground

by bradleytrager

HTML

<div class="leftcol">
    <p>Make a choice:
        <select name="select1">
            <option id="show">Show</option>
            <option id="hide" selected="selected">Hide</option>
        </select>
    </p>
    <br/>
    <div id="text1line">Textbox 1:
        <input type="text" id="text1" />
    </div>
</div>
<div class="rightcol">Textbox 2:
    <input type="text" id="text2" />
    <br/>Textbox 3:
    <input type="text" id="text3" />
</div>

CSS

.leftcol, .rightcol {
   float: left;
   width: 50%;
}

JavaScript

$(document).ready(function () {
            $("#text1line").hide();
            $("select[name='select1']").change(function () {
                if ($(this).children("option:selected").attr("id") === "show") {
                    $("#text1line").show();
                } else {
                    $("#text1line").hide();
                }
            });
        });