JSFiddle - React, Tailwind, and code Playground

HTML

<select id="myBox">
  <option style="color:red">
    red
  </option>
  <option style="color:blue">
    blue
  </option>
  <option style="color:green">
    green
  </option>
</select>

JavaScript

$().ready(function(){
    $("#myBox").on("change",function()
    {
      var style = $(this).find("option:selected").attr("style");  
      $(this).attr("style",style);  
    });
});