JSFiddle - React, Tailwind, and code Playground

by joplomacedo

HTML

<select class="mySelect">
    <option>Option-1</option>
    <option>Option-2</option>
    <option>Option-3</option>
    <option>Option-4</option>
</select>

CSS

http://stackoverflow.com/questions/11781735/hide-selected-value-in-select-element

JavaScript

var $mySelect = $('.mySelect'),
    $mySelect_options = $mySelect.find('option'),
    $mySelect_options_txt = [],
    
    emptyTxt = function () {
        $mySelect_options.text('');
    };
    
//store options txt
$mySelect_options.each(function() {
    $mySelect_options_txt.push($(this).text());
});

//empty options txt
emptyTxt();

//events
$mySelect.on({
    mousedown: function() {
        var i = 0;
        $mySelect_options.each(function() {
            $(this).text($mySelect_options_txt[i]);
            i++;
        });
    },
    blur: emptyTxt,
    change: emptyTxt
});