JSFiddle - React, Tailwind, and code Playground

HTML

<script type="text/javascript">
    function dataCap(){
    var dataCap = document.getElementById("selected2").value;
    document.getElementById('show').innerHTML = "This is your selection:" + dataCap;
}
</script>

<select id="selected2" onchange="dataCap()">
      <option selected value=""></option>
      <option value="2">2</option>
      <option value="3">3</option>
  </select>
<div id="show"></div>