JSFiddle - React, Tailwind, and code Playground

by Jonathan Sampson

HTML

<select>
    <optgroup label="Other" id="custom">
        <option value="mentorCustom">Search For Agent</option>
    </optgroup>
</select>

<button>Add Option</button>

JavaScript

(function () {
   
    "use strict";
    
    var custom = document.querySelector( "#custom" );
    var button = $("button");
    
    button.on("click", addOption);
    
    function addOption () {
        $("<option>").text( +new Date ).appendTo( custom );
    }
    
}());