JSFiddle - React, Tailwind, and code Playground

HTML

<select id="item2">
    <option>--Please select--
    <option>t1
    <option>t2
</select>

JavaScript

$(document).ready(function(){
 test("price");
 alert("hi");
 $("#item2").change(function() 
    { 
        sort= $("#item2").val(); 
        test(sort);
    }); 
 });

function test(s)
{
    alert(s);
}