JSFiddle - React, Tailwind, and code Playground

by John Doe

HTML

<form id="currency_converter">
  <label for="currency_switcher" class="currency_switcher_label">Choose a Currency</label>
  <select id="currency_switcher" class="currency_switcher select">
    <option value="USD">USD</option>
    <option value="AUD">AUD</option>
    <option value="GBP">GBP</option>
    <option value="EUR">EUR</option>
  </select>

</form>

JavaScript

$(function() {
  $("#currency_converter select").each(function() {
    var text = $(this).prev("label").text();
    $(this).children("option[selected='selected']").val(text).text(text);
  }).prev().hide();
});