JSFiddle - React, Tailwind, and code Playground

HTML

Select One
<select>
    <option>Item1</option>
    <option>Item2</option>
    <option>Item3</option>
    <option class="hidden">Item4</option>
    <option class="hidden">Item5</option>
</select>

<p>
<button id="add">Click to add the hidden elements</button>
<button id="remove">Click to remove the hidden elements</button>
</p>

JavaScript

var array = $(".hidden");
$(".hidden").remove();

$("#add").bind("click",function(){
    $("select").append(array);
});

$("#remove").bind("click",function(){
    $(".hidden").remove();
});