JSFiddle - React, Tailwind, and code Playground

by greatCar

HTML

<select name="history" id="history"  >
 <option value="history1">history 1</option>
 <option value="history2">history 2</option>
 <option value="clearhistory">Clear History</option>
</select>

JavaScript

function historyChanged() {
    var historySelectList = $('select#history');
    var selectedValue = $('option:selected', historySelectList);


    alert(selectedValue.val());

    if (selectedValue == 'clearHistory') {
        historySelectList.form.submit();
    }
}

$(function() {
 //   alert('my alert');
  $('select#history').change(historyChanged);
});