Updating table from selected option

https://stackoverflow.com/questions/50189352/displaying-field-values-from-the-drop-down-list

HTML

<select id="mySelect">
  <option>lorem</option>  
  <option>ipsum</option>  
  <option>dolor</option>
</select>

<div class="table"></div>

JavaScript

$('#mySelect').on('change', function() {
  $('.table').html(`info for ${$('#mySelect option:selected').text()}`);
});