JSFiddle - React, Tailwind, and code Playground

by Murali Kaliappan

HTML

<select onchange="anotherFunction(event)">
  <option value="first">Hello World 1</option>
  <option value="second">Hello World 2</option>
  <option value="third">Hello World 3</option>
  <option value="fourth">Hello World 4</option>
</select>

JavaScript

function anotherFunction(event) {
    var a = $("select :selected").val();
    console.log(a)
}