JSFiddle - React, Tailwind, and code Playground

by Hari Menon

HTML

<script src="https://github.com/douglascrockford/JSON-js/raw/master/json2.js"></script>
<select id="foo">
    <option value="">---Selected One---</option>
    <option value="a">a</option>
    <option value="b">b</option>
</select><br />
By Index: <input type="text" id="byIndex" /><br />
By Get: <input type="text" id="byGet" />

CSS

input {
    width:75%;
}

JavaScript

$('#foo').change(function(e) {
    $('#byIndex').val(JSON.stringify($('#foo')[0]));
    $('#byGet').val(JSON.stringify($('#foo').get(0)));
});