JSFiddle - React, Tailwind, and code Playground

HTML

<input type="hidden" name="fake_selectbox" id="fake" value=""/>

<div id="box">
    Click here
</div>
<div id="select">
    <div data-id="1">first</div>
    <div data-id="2">second</div>
</div>

CSS

#box { width:80px;height: 20px; background-color: red; cursor: pointer; }
#select { cursor:pointer; display: none; background-color: yellow; width: 80px; }

JavaScript

$("#box").click(function(){
        $("#select").toggle();
    });
    
    $("#select").children().click(function(){ 
        $("#box").html($(this).html());
        $("#fake").val($(this).data("id"));
        $(this).parent().hide();
    });