JSFiddle - React, Tailwind, and code Playground

by nogoodatcoding

HTML

<table>
    <tr>
        <td><span id="label1">Label</span>
            <select id="selector" style="display:none"><option id="option1" value="option1">option1</option><option id="option2" value="option2">option2</option></select>
    </td>
    <td>Content</td></tr>
</table>

CSS

table td {
    border: 1px dotted #666;
    border-collapse: collapse;
    padding: 2px;
}

JavaScript

$('#label1').click(function(){
    $(this).hide();
    $('#selector').show();
});


$('#selector').bind('change', function(){
    $('#label1').text($("#selector option:selected").val());
    $(this).hide();
    $('#label1').show();
});