JSFiddle - React, Tailwind, and code Playground
HTML
<select>
<option id="first">one</option>
<option id="second">two</option>
<option id="third">three</option>
<option id="fourth">four</option>
<option id="fifth">five</option>
<option id="sixth">six</option>
</select>
<div id="print"></div>
JavaScript
var LIMIT = 4; // limit to the fourth element
$("option").each(function( index, object ) {
$("#print").append( index+" -> "+object.id+"<br/>" );
if(index+1>LIMIT){
object.remove();
}
});