JSFiddle - React, Tailwind, and code Playground

HTML

<table>
  <tr>
    <td>Company</td>
    <td>
      <select id="namelist" name="namelist" onchange="updateinput(this)">
        <option>Select data</option>
        <option data-email='abc1@abc.com' data-name='abc1 xyz' value='test'>test1</option>

        <option data-email='abc2@abc.com' data-name='abc2 xyz' value='test'>test2</option>
      </select>
    </td>
  </tr>
  <tr>
    <td>Name of contact</td>
    <td>
      <input required id="namecontact" name="namecontact" type="text" placeholder="Client name">
    </td>
  </tr>
  <tr>
    <td>E-Mail contactpersoon</td>
    <td>
      <input required id="email" name="email" type="text" placeholder="E-Mail">
    </td>
  </tr>
</table>

JavaScript

function updateinput(e) {
  var selectedOption = e.options[e.selectedIndex];
  document.getElementById('namecontact').value = selectedOption.getAttribute('data-name');
  document.getElementById('email').value = selectedOption.getAttribute('data-email');

}