JSFiddle - React, Tailwind, and code Playground

by Sivasakthi Chandrasekaran

HTML

<select>
    <option value="1">1</option>
    <option value="2">2</option>
    <option value="3">3</option>
</select>

JavaScript

$('select :[value=2]').prop("selected", true);
alert($('select :selected').text());

$('select option:first-child').prop("selected", true);
alert($('select :selected').text());