JSFiddle - React, Tailwind, and code Playground

by elizabethkmathew

HTML

<form>
<select id="mySelect" size="4" multiple>
  <option>Apple</option>
  <option>Pear</option>
  <option>Banana</option>
  <option>Orange</option>
</select>
</form>

<button id="print-value">
Print
</button>

JavaScript

$("#mySelect").change(function() {
alert($("#mySelect").val());
});

$("#print-value").click(function() {
	alert("value:" + $("#mySelect option:selected").text());
});