JSFiddle - React, Tailwind, and code Playground

by hotbelgo

HTML

<table>
  <tr>
    <td id="toChange">
        Should go here:
      <p><select id="select"> 
        <option value="Value 1">Value 1</option>
        <option value="Value 2">Value 2</option>
          </select></p>
    </td>
  </tr>
</table>

JavaScript

$("#select").on("change", function() {
    var v = $(this).val();
    console.log(v);
    //$("#toChange").innerHTML=v;
    $(this).parent().remove().innerHTML= v;
});